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

fix: convert sys.exit(1) to ValueError in DataDiscoveryCLI #1020

Merged
merged 2 commits into from
Feb 1, 2024
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
6 changes: 2 additions & 4 deletions src/coffea/dataset_tools/dataset_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,9 @@ def load_dataset_definition(
# Now selecting the results depending on the interactive mode or not.
# Metadata are passed to the selection function to associated them with the selected dataset.
if query_results_strategy not in ["all", "manual"]:
print(
raise ValueError(
"Invalid query-results-strategy option: please choose between: manual|all"
)
exit(1)
elif query_results_strategy == "manual":
self.do_select(selection=None, metadata=dataset_meta)
else:
Expand All @@ -603,10 +602,9 @@ def load_dataset_definition(
out_replicas = self.do_replicas(mode=None, selection="all")
else:
if replicas_strategy not in ["round-robin", "choose", "first"]:
print(
raise ValueError(
"Invalid replicas-strategy: please choose between manual|round-robin|choose|first"
)
exit(1)
out_replicas = self.do_replicas(mode=replicas_strategy, selection="all")
# Now list all
self.do_list_selected()
Expand Down