-
Notifications
You must be signed in to change notification settings - Fork 14
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-40120: Add without_datastore flag to Butler #867
Conversation
This can be used if you know you are only querying a registry and not interested in whether the datastore is usable or not.
Optional means that the user will be uncertaint whether they have a datastore or not. Skip means that the user is guaranteed that datastore will not work.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #867 +/- ##
==========================================
+ Coverage 87.72% 87.76% +0.03%
==========================================
Files 274 274
Lines 35937 36057 +120
Branches 7537 7562 +25
==========================================
+ Hits 31526 31645 +119
Misses 3241 3241
- Partials 1170 1171 +1
☔ View full report in Codecov by Sentry. |
): | ||
# Name ourselves with the timestamp the datastore | ||
# was created. | ||
self.name = f"{type(self).__name__}@{time.time()}" |
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.
Why do we need the timestamp? Two NullDatastore
instances should be identical (it could even be a singleton, though I don't think it needs to be), and I'd hope that means we don't need to care about conflicts.
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.
Good point, although since this datastore should never result in a dataset being stored anywhere there's no requirement for it to be a fixed name. The time is really there to let you know when you created that butler and it will appear in stringified output of Butler
. Whether anyone cares is a question.
This makes it match the other datastores when the dataset is not present.
This allows
butler = Butler(uri, skip_datastore=True)
to return a Butler instance that has no connection to a real datastore. I've also modified script implementations to add the flag where appropriate.Checklist
doc/changes