Skip to content

Conversation

kfindeisen
Copy link
Member

This PR replaces the old _query_missing_datasets with a new function, _filter_datasets, that raises if the source repository does not have anything matching the query. This behavior is needed in all contexts where MiddlewareInterface queries both the central and local repositories, though it's inappropriate for a general-purpose query.

The new name, _filter_datasets, does not carry the previous connotation
of being a query, allowing future changes to impose behavior that is
not query-like but is needed by MiddlewareInterface.
We need to distinguish the case where the source repo has datasets but
they're redundant with the destination (nothing to do) from the case
where the datasets are absent entirely (impending pipeline failure).
The _filter_datasets function now checks if the source query is empty
before filtering.

Because of the behavior change, the unit tests of prep_butler had to be
amended to avoid raising on missing templates.
@kfindeisen kfindeisen requested a review from isullivan March 2, 2023 21:21
Copy link
Member

@isullivan isullivan left a comment

Choose a reason for hiding this comment

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

Looks very good. I appreciate the unit test testing the new functionality.

@kfindeisen kfindeisen merged commit 6b28267 into main Mar 3, 2023
@kfindeisen kfindeisen deleted the tickets/DM-37745 branch March 3, 2023 18:03
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