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

DM-40120: Add without_datastore flag to Butler #867

Merged
merged 8 commits into from
Jul 21, 2023
Merged

DM-40120: Add without_datastore flag to Butler #867

merged 8 commits into from
Jul 21, 2023

Conversation

timj
Copy link
Member

@timj timj commented Jul 20, 2023

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

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

timj added 4 commits July 20, 2023 12:41
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
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch coverage: 96.99% and project coverage change: +0.03 🎉

Comparison is base (1fe3838) 87.72% compared to head (34be32a) 87.76%.

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     
Impacted Files Coverage Δ
...thon/lsst/daf/butler/script/certifyCalibrations.py 35.29% <0.00%> (ø)
python/lsst/daf/butler/_butlerConfig.py 95.65% <80.00%> (-1.28%) ⬇️
python/lsst/daf/butler/core/datastore.py 94.80% <94.73%> (-0.04%) ⬇️
python/lsst/daf/butler/_butler.py 78.89% <100.00%> (+0.05%) ⬆️
python/lsst/daf/butler/script/collectionChain.py 84.09% <100.00%> (ø)
python/lsst/daf/butler/script/queryCollections.py 91.17% <100.00%> (ø)
python/lsst/daf/butler/script/queryDataIds.py 86.66% <100.00%> (ø)
python/lsst/daf/butler/script/queryDatasetTypes.py 100.00% <100.00%> (ø)
python/lsst/daf/butler/script/queryDatasets.py 89.55% <100.00%> (+0.15%) ⬆️
...on/lsst/daf/butler/script/queryDimensionRecords.py 74.19% <100.00%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

python/lsst/daf/butler/_butler.py Show resolved Hide resolved
):
# Name ourselves with the timestamp the datastore
# was created.
self.name = f"{type(self).__name__}@{time.time()}"
Copy link
Member

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.

Copy link
Member Author

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.

python/lsst/daf/butler/core/datastore.py Outdated Show resolved Hide resolved
@timj timj changed the title DM-40120: Add skip_datastore flag to Butler DM-40120: Add without_datastore flag to Butler Jul 21, 2023
@timj timj merged commit 4cd0e03 into main Jul 21, 2023
@timj timj deleted the tickets/DM-40120 branch July 21, 2023 19:23
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