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-37704: Remove support for unresolved references #36

Merged
merged 1 commit into from
May 26, 2023
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
13 changes: 7 additions & 6 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def setUp(self):

def _get_datasets_from_chain(self, chain, datasetType=...):
"""Return all the datasets from the first run in chain.

Datasets are all unresolved.
"""
collections = list(self.butler.registry.queryCollections(chain, flattenChains=True))
# Choose the collection to query, and query datasets in that
Expand All @@ -63,9 +61,8 @@ def _get_datasets_from_chain(self, chain, datasetType=...):
collections.remove(run)
print(f"Retrieving datasets from run {run}")

unresolved = {ref.unresolved() for ref in self.butler.registry.queryDatasets(datasetType=datasetType,
collections=run)}
return unresolved
refs = set(self.butler.registry.queryDatasets(datasetType=datasetType, collections=run))
return refs

def testMetadata(self):
"""Test that metadata can be retrieved."""
Expand Down Expand Up @@ -100,7 +97,11 @@ def testExecutionButler(self):
self.assertGreater(len(datasets), 0)
self.assertEqual(len(main_datasets), len(datasets))

difference = main_datasets - datasets
# Extract dataset type and DataIds for comparison.
main_data_ids = {(ref.datasetType, ref.dataId) for ref in main_datasets}
data_ids = {(ref.datasetType, ref.dataId) for ref in datasets}

difference = main_data_ids - data_ids
self.assertEqual(len(difference), 0, "Some datasets missing.")

def testExecutionExistence(self):
Expand Down