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-26688: Add command-line tool for Registry.associate #459
Conversation
This work is built on top of the branch tickets/DM-26689, it will get checked in after that one. |
butler = Butler(repo, writeable=True) | ||
|
||
if butler.registry.getCollectionType(collection) is not CollectionType.CHAINED: | ||
raise RuntimeError("Can only add datasets to a chained 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.
Instead of this check, let's do
butler.registry.registerCollection(collection, CollectionType.TAGGED)
- This will create the collection if it does not exist, which will be very convenient, and it will raise an exception if it exists with the wrong type.
- The type needs to be
TAGGED
, notCHAINED
find_first=find_first, | ||
show_uri=False, | ||
repo=None | ||
) |
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 like the idea of calling the script rather than the native method to share logic like transforming globs to regexes. Do we need to worry about the script also doing unnecessary things (like making astropy Tables) at all?
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.
QueryDatasets generates astropy tables on demand via the getter (getTables
), so it's structured to not create these if they're not needed. (I do see a mistake in passing the QueryDatasets results to the butler without using the accessor, will fix)
4efd618
to
3f709d7
Compare
e55d966
to
7829756
Compare
2fb787d
to
18a095a
Compare
6d683fd
to
1419c4d
Compare
This allows reuse of the options that are needed to call query datasets.
1419c4d
to
a0b9141
Compare
No description provided.