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

feat: add datasets delete command #3703

Merged
merged 10 commits into from
Sep 4, 2023

Conversation

gabrielmbmb
Copy link
Member

Description

This PR adds a new command datasets delete that allows to delete FeedbackDatasets. In addition, a custom callback has been added for the group of commands datasets in which a --name and a --workspace can be provided to load a FeedbackDataset that will be used for an operation. Apart from that, the push-to-hugginface command has been updated to display an spinner.

Closes #3691

Type of change

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

How Has This Been Tested

In a local development environment:

  • python -m argilla datasets --name feedback-dataset --workspace gabriel delete: deletes the FeedbackDataset successfully.

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
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@gabrielmbmb gabrielmbmb added type: enhancement Indicates new feature requests area: cli Indicates that an issue or pull request is related to the Command Line Interface (CLI) labels Sep 4, 2023
@gabrielmbmb gabrielmbmb added this to the v1.16.0 milestone Sep 4, 2023
@gabrielmbmb gabrielmbmb self-assigned this Sep 4, 2023
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage is 82.05% of modified lines.

❗ Current head 82a9923 differs from pull request most recent head 8768af9. Consider uploading reports for the commit 8768af9 to get more accurate results

Files Changed Coverage
src/argilla/tasks/datasets/__main__.py 68.18%
src/argilla/tasks/datasets/delete.py 100.00%
src/argilla/tasks/datasets/push.py 100.00%

📢 Thoughts on this report? Let us know!.

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

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

Copy link
Member

@alvarobartt alvarobartt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor comments/questions


try:
dataset.delete()
except RuntimeError as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can also handle PermissionError which is raised by allow_for_roles decorator if the user doesn't have owner role

return_value=remote_feedback_dataset,
)

result = cli_runner.invoke(cli, "datasets --name my-dataset push-to-huggingface")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current approach for the CLI as datasets [NAME] [WORKSPACE] [CMD] [ARGS] shouldn't we make CMD show the --help by default? Or do we want it to fail if no args are provided? I guess it would depend on whether we have commands without args or not, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean whether we should include no_args_is_help=True the the CMD e.g. push-to-huggingface

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see! I think it's better to not show by default the --help

@gabrielmbmb gabrielmbmb merged commit 1787ee1 into develop Sep 4, 2023
@gabrielmbmb gabrielmbmb deleted the feature/cli-delete-dataset-command branch September 4, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli Indicates that an issue or pull request is related to the Command Line Interface (CLI) type: enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add delete dataset command python -m argilla datasets delete
2 participants