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-46339: fix regression in glob detection in query-datasets #1080

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Sep 16, 2024

CHAINED collections could masquerade as globs with the previous logic. With the new logic, we're probably trying to turn each string into a regex more than one time, but that shouldn't be very expensive.

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 Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (4a59ea5) to head (b9c8216).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1080   +/-   ##
=======================================
  Coverage   89.69%   89.69%           
=======================================
  Files         360      360           
  Lines       47054    47059    +5     
  Branches     9660     9661    +1     
=======================================
+ Hits        42206    42211    +5     
  Misses       3480     3480           
  Partials     1368     1368           

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

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

One real change requested but I'll make approved anyhow on the assumption it will be changed.

@@ -261,7 +262,7 @@ def getDatasets(self) -> Iterator[list[DatasetRef]]:
summary_datasets=dataset_types,
)
expanded_query_collections = [c.name for c in query_collections_info]
if self._find_first and set(query_collections) != set(expanded_query_collections):
if self._find_first and any(has_globs(c) for c in query_collections):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self._find_first and any(has_globs(c) for c in query_collections):
if self._find_first and has_globs(query_collections):

has_globs takes an iterable.

CHAINED collections could masquerade as globs with the previous logic.
With the new logic, we're probably trying to turn each string into a
regex more than one time, but that shouldn't be very expensive.
@TallJimbo TallJimbo merged commit 910bec6 into main Sep 16, 2024
18 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-46339 branch September 16, 2024 19:31
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