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-33902 Long chained collections print badly via CLI #20

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,16 @@ def _get_datasets_from_chain(self, chain, datasetType=...):
Datasets are all unresolved.
"""
collections = list(self.butler.registry.queryCollections(chain, flattenChains=True))
run = collections.pop(0)
# Choose the collection to query, and query datasets in that
# collection.
# The collection to query datasets from will be named "demo_collection"
# or "demo_collection_exe/YYYMMDD" (the exe collection is inserted in
# run_demo.sh). Collections will only contain one or the other (and no
# other collections named "demo_colleciton") so it is enough to just
# find the one with the name that contains "demo_collection" and use
# search it to resolve the other datasets.
run = next(c for c in collections if "demo_collection" in c)
collections.remove(run)
print(f"Retrieving datasets from run {run}")

unresolved = {ref.unresolved() for ref in self.butler.registry.queryDatasets(datasetType=datasetType,
Expand Down