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
DM-33634: Add pipetask purge and cleanup subcommands #178
Conversation
874e10a
to
cbf395f
Compare
cbf395f
to
e154e9f
Compare
Codecov Report
@@ Coverage Diff @@
## main #178 +/- ##
==========================================
+ Coverage 81.38% 82.55% +1.16%
==========================================
Files 41 47 +6
Lines 3298 3628 +330
Branches 550 588 +38
==========================================
+ Hits 2684 2995 +311
- Misses 454 465 +11
- Partials 160 168 +8
Continue to review full report at Codecov.
|
butler_config : str | ||
The path location of the gen3 butler/registry config file. | ||
collection : str | ||
TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing docstring.
self.type = type | ||
|
||
def __str__(self): | ||
return f'COLLETION must be a CHAINED collection, "{self.collection}" is a "{self.type}" collection.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: COLLETION
butler = Butler(self.butler_config, writeable=True) | ||
for collection in self.others_to_remove: | ||
butler.registry.removeCollection(collection) | ||
butler.removeRuns(self.runs_to_remove) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth wrapping this line and the for loop above in with butler.transaction()
so it's all atomic.
""" | ||
pass | ||
|
||
@abstractmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe
@property
@abstractmethod
is now preferred.
|
||
def __str__(self): | ||
parents = ", ".join([f'"{p}"' for p in self.parents]) | ||
return f'Collection "{self.child}" is in multiple chained collections: {parents}.\n' + advice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you've already got an f-string going, just interpolate advice
in, too.
def __init__(self, butler_config: str): | ||
self.runs_to_remove = [] | ||
self.chains_to_remove = [] | ||
self.others_to_remove = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making these set
s instead of list
s seems like would reflect the usage better, unless you're concerned about printing them for confirmation in a way that maintains order.
purge_result : PurgeResult | ||
The description of what datasets to remove and/or failures encountered | ||
while preparing to remove datasets to remove, and a completion function | ||
to remove the datests after confirmation, if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: datests
Checklist
doc/changes