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

Delete Dataset From CLI #519

Merged
merged 4 commits into from
Nov 14, 2024
Merged

Delete Dataset From CLI #519

merged 4 commits into from
Nov 14, 2024

Conversation

BenGalewsky
Copy link
Contributor

Problem

User's can't delete a dataset from the cache. They also can't see the details of a DID to debug

Approach

Add some new commands to the CLI

servicex datasets get -b testing2 15

This gets back the details of Dataset ID 15...

                                             
                                                                        Dataset ID 15                                                                        
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Paths                                                                                                                                                     ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓         │
│ ┃ File ID: 968                                                                                                                                  ┃         │
│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩         │
│ │ https://xenia.nevis.columbia.edu:1094/atlas/dq2/rucio/user/mtost/06/a1/user.mtost.40294033._000002.less_jet_and_new_GN.root                   │         │
│ │ root://xrootd.data.net2.mghpcc.org:1094//USATLAS/atlasscratchdisk/rucio/user/mtost/06/a1/user.mtost.40294033._000002.less_jet_and_new_GN.root │         │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘         │
│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓         │
│ ┃ File ID: 969                                                                                                                                  ┃         │
│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩         │
│ │ https://xenia.nevis.columbia.edu:1094/atlas/dq2/rucio/user/mtost/23/8b/user.mtost.40294033._000001.less_jet_and_new_GN.root                   │         │
│ │ root://xrootd.data.net2.mghpcc.org:1094//USATLAS/atlasscratchdisk/rucio/user/mtost/23/8b/user.mtost.40294033._000001.less_jet_and_new_GN.root │         │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘         │

You can delete a dataset with the new command

servicex datasets delete -b testing2 1  

Do this and the server will refreash the dataset when you submit a new request.

Finally, there is a command line option to see deleted datasets (by default they are omited from the dataset report)

 servicex datasets list -b localhost --show-deleted 

The ServiceX deployed on testing2 has been updated to have the endpoints needed for testing this

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

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

Project coverage is 83.05%. Comparing base (c58c5aa) to head (2e9ebb5).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
servicex/app/datasets.py 0.00% 24 Missing ⚠️
servicex/servicex_adapter.py 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #519      +/-   ##
==========================================
- Coverage   83.86%   83.05%   -0.82%     
==========================================
  Files          27       27              
  Lines        1599     1670      +71     
==========================================
+ Hits         1341     1387      +46     
- Misses        258      283      +25     
Flag Coverage Δ
unittests 83.05% <68.29%> (-0.82%) ⬇️

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.

This follows the examples used by the transform methods and allows us to
use the _extract_message function to get better error messages.

During development of this I learned that in unit tests that test for
exceptions, any assertions inside the pytest.raises context manager
will not be executed! Fixed numerous examples of that.
Copy link
Collaborator

@ponyisi ponyisi left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the concerns

@ponyisi ponyisi merged commit 2efa2f4 into master Nov 14, 2024
40 of 42 checks passed
@ponyisi ponyisi deleted the delete_dataset branch November 14, 2024 21:47
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.

2 participants