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

Update data registry syntax for v1 #117

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions ceci/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,18 +524,23 @@ def data_registry_lookup(self, info): #pragma: no cover
else:
raise ValueError("Must specify either id or name in registry lookup")

# Whatever the lookup, we always require a dataset which has not beed deleted or replaced
status_filter = registry.Query.gen_filter("dataset.status", "==", 1)

# Main finder method
results = registry.Query.find_datasets(["dataset.dataset_id"], [filter])
results = registry.Query.find_datasets(["dataset.dataset_id"], [filter, status_filter])

# Check that we find exactly one dataset matching the query
results = list(results)
if len(results) == 0:
if not results:
raise ValueError(f"Could not find any dataset matching {info} in registry")
elif len(results) > 1:

results = results['dataset.dataset_id']

if len(results) > 1:
raise ValueError(f"Found multiple datasets matching {info} in registry")

# Get the absolute path
return registry.Query.get_dataset_absolute_path(results[0].dataset_id)
return registry.Query.get_dataset_absolute_path(results[0])


def process_overall_inputs(self, inputs):
Expand Down
Loading