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-43526: Implement registry collection methods for RemoteButler #983

Merged
merged 6 commits into from Mar 28, 2024

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Mar 27, 2024

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 97.39130% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 88.94%. Comparing base (b51dcee) to head (6d4ae7a).

Files Patch % Lines
python/lsst/daf/butler/remote_butler/_registry.py 82.35% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #983      +/-   ##
==========================================
+ Coverage   88.92%   88.94%   +0.01%     
==========================================
  Files         329      329              
  Lines       42351    42442      +91     
  Branches     8704     8716      +12     
==========================================
+ Hits        37660    37749      +89     
  Misses       3441     3441              
- Partials     1250     1252       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dhirving dhirving marked this pull request as ready for review March 27, 2024 23:40

def setCollectionChain(self, parent: str, children: Any, *, flatten: bool = False) -> None:
raise NotImplementedError()

def getCollectionParentChains(self, collection: str) -> set[str]:
raise NotImplementedError()
info = self._butler._get_collection_info(collection, include_parents=True)
assert info.parents is not None
Copy link
Member

Choose a reason for hiding this comment

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

assert does trigger a philosophical debate here as to what happens if it ever fails. The error message that you get is never helpful. Consider RuntimeError with an error message instead? (or at least add a message to the assert).

@@ -271,7 +281,15 @@ def queryCollections(
flattenChains: bool = False,
includeChains: bool | None = None,
) -> Sequence[str]:
raise NotImplementedError()
if includeChains is None:
Copy link
Member

Choose a reason for hiding this comment

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

@TallJimbo what's the plan for the datasetType parameter? It's not in this implementation and is ignored in sql registry, but should the client code forward it to the server on the assumption that at some point the direct butler might use it? Or are we okay acting like it doesn't exist (the documentation doesn't seem to say that it's ignored and sql_registry mentions DM-24939 which is Done but hasn't fixed the problem).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it gets implemented in DirectButler someday it can get added here at the same time. It sounds like we're leaning towards re-designing this interface entirely, so we can drop it from the new interface or make it actually work there.

I don't like having unused variables/features hanging around because their existence implies to future readers that they are used for something, which can end up wasting a lot of time.

Copy link
Member

Choose a reason for hiding this comment

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

I think we drop it here, and RFC dropping it from DirectButler (and the CLI) when we RFC dropping regex support there.

SqlRegistry is no longer a public interface, and _get_collection_record is used outside SqlRegistry a few places, so removing the leading underscore for clarity.
Implement additional registry methods for RemoteButler
Implement registry.getCollectionDocumentation and registry.getCollectionParentChains for RemoteButler.
@dhirving dhirving merged commit 704083d into main Mar 28, 2024
18 checks passed
@dhirving dhirving deleted the tickets/DM-43526 branch March 28, 2024 22:37
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.

None yet

3 participants