Skip to content

Commit

Permalink
Merge pull request #1020 from iasonkrom/fix-exit
Browse files Browse the repository at this point in the history
fix: convert sys.exit(1) to ValueError in DataDiscoveryCLI
  • Loading branch information
lgray committed Feb 1, 2024
2 parents 41f0162 + 11a0330 commit 3428ee2
Showing 1 changed file with 2 additions and 4 deletions.
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

0 comments on commit 3428ee2

Please sign in to comment.