Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE-BRANCH] feat: dataset export to the Hub #5730

Merged
merged 20 commits into from
Dec 17, 2024

Conversation

jfcalvo
Copy link
Member

@jfcalvo jfcalvo commented Dec 4, 2024

Description

This is the feature branch with the joining efforts (UI + Backend) for the new feature allowing users to export datasets from Argilla to the HF Hub.

# Description

This PR adds a new endpoint to support exporting an Argilla dataset to
HuggingFace Hub.

Being the endpoint `POST /api/v1/datasets/:dataset_id/export` with the
following expected body:
- `name`: the name of the dataset to be created on HF Hub. i.e.
`username/my-new-dataset`.
- `subset` (optional, default: `default`): the subset of the dataset to
be created.
- `split` (optional, default: `train`): the split of the dataset to be
created.
- `private` (optional, default: `false`): whether the dataset should be
private or not.
- `token`: the HF Hub API access token to create the dataset, it should
have WRITE access.

**Type of change**

- New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [x] Testing manually exporting some datasets.

**Checklist**

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
@jfcalvo jfcalvo marked this pull request as ready for review December 4, 2024 12:33
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 89.25620% with 26 lines in your changes missing coverage. Please review.

Project coverage is 92.10%. Comparing base (e3938e8) to head (c6cc2fd).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
argilla-server/src/argilla_server/contexts/hub.py 90.85% 15 Missing ⚠️
argilla-server/src/argilla_server/database.py 73.33% 4 Missing ⚠️
...gilla-server/src/argilla_server/models/database.py 88.23% 4 Missing ⚠️
argilla-server/src/argilla_server/jobs/hub_jobs.py 50.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5730      +/-   ##
===========================================
- Coverage    92.25%   92.10%   -0.15%     
===========================================
  Files          161      161              
  Lines         6676     6894     +218     
===========================================
+ Hits          6159     6350     +191     
- Misses         517      544      +27     
Flag Coverage Δ
argilla-server 92.10% <89.25%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

The URL of the deployed environment for this PR is https://argilla-quickstart-pr-5730-ki24f765kq-no.a.run.app

jfcalvo and others added 17 commits December 11, 2024 09:43
# Description

This PR includes a suite of tests for `HubDatasetExporter` class,
checking the most common scenarios for exporting datasets from Argilla
to the Hub.

**Type of change**

- Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

- [ ] Running the test suite. Writing the last examples I got a
rate-limiting error so I will try to run them on GitHub.

**Checklist**

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
)

# Description

Add support to export suggestions to the Hub with `HubDatasetExport`.

**Type of change**

- New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [x] Adding new tests for every type of question including suggestions.

**Checklist**

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
This includes some fixes and improvements in the export to hub feature
UI

- [x] Fix private / public info on exporting
- [x] Prevent the dialog from closing when dragging on text inputs
- [x] Update exporting dialog styles
- [x] New Tooltip plugin
- [x] Update translations

---------

Co-authored-by: Damián Pumar <[email protected]>
# Description

Only adding record's `inserted_at` and `updated_at` to the list of
record attributes used with `HubDatasetExport`.

**Type of change**

- New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [x] Changing the test suite for `HubDatasetExporter`.

**Checklist**

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
…o the hub (#5759)

# Description

Some questions were not rendering values correctly when generating the
README dataset card. This PR includes some changes to fix that problem.

**Type of change**

- Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

- [x] Manually uploading a dataset to the hub with all kinds of
questions.

**Checklist**

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
@jfcalvo jfcalvo merged commit 9f839ce into develop Dec 17, 2024
9 of 10 checks passed
@jfcalvo jfcalvo deleted the feat/export-dataset-to-hub-feature-branch branch December 17, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants