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-43157: new query interfaces for dataset types and datasets of multiple types #1062

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TallJimbo
Copy link
Member

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

@TallJimbo TallJimbo force-pushed the tickets/DM-43157 branch 2 times, most recently from 6d1163b to 174b8fa Compare August 21, 2024 16:51
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.38%. Comparing base (6cb0823) to head (8bac470).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1062      +/-   ##
==========================================
+ Coverage   89.37%   89.38%   +0.01%     
==========================================
  Files         362      365       +3     
  Lines       48288    48339      +51     
  Branches     5872     5872              
==========================================
+ Hits        43155    43206      +51     
  Misses       3718     3718              
  Partials     1415     1415              

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

@TallJimbo TallJimbo force-pushed the tickets/DM-43157 branch 2 times, most recently from 5396bb0 to 783f3ee Compare August 21, 2024 17:48
"""Methods for working with the dataset types known to the Butler."""

@abstractmethod
def get(self, name: str) -> DatasetType:
Copy link
Member

Choose a reason for hiding this comment

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

Are we going to immediately deprecate butler.get_dataset_type and move to butler.dataset_type.get() ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that'd be best, yes, if we all like butler.dataset_types more generally.

Copy link
Contributor

@dhirving dhirving left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

Comment on lines +97 to +101
# - 'where' exists on other result objects because the way they are
# constructed adds context (a dataset search join, some dimensions) that
# can help interpret arguments to 'where'. That's not generally true
# here, so calling `Query.where(...).all_datasets()` can do anything that
# `Query.all_datasets().where(...)` might be able to do.
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to have where just for consistency.

Comment on lines +94 to +95
# - 'order_by' and 'limit' are hard to implement in the common case where
# we have to run one query for each dimension group.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think limit is probably desirable since these queries can easily return huge numbers of results. Should be relatively straightforward to implement if we're executing the queries serially -- you just start with the original limit and subtract from it for each subsequent query.

@andy-slac
Copy link
Contributor

Rebased to current main.

@andy-slac andy-slac force-pushed the tickets/DM-43157 branch 2 times, most recently from f0a0cbf to 7e5ed85 Compare September 18, 2024 19:28
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.

4 participants