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

Remove doc-filter after query switched to unified syntax #738

Merged
merged 4 commits into from
Apr 14, 2023
Merged
Changes from 2 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
24 changes: 6 additions & 18 deletions flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4223,12 +4223,6 @@ def _add_job_selection_args(cls, parser):
nargs="+",
help="Only select jobs that match the given state point filter.",
)
parser.add_argument(
"--doc-filter",
type=str,
nargs="+",
help="Only select jobs that match the given document filter.",
)

@classmethod
def _add_operation_selection_arg_group(cls, parser):
Expand Down Expand Up @@ -4757,7 +4751,6 @@ def _main_status(self, args):
"debug",
"job_id",
"filter",
"doc_filter",
]
}
if args.pop("full"):
Expand Down Expand Up @@ -4876,14 +4869,10 @@ def operation_function(job):
operation_function(*aggregate)

def _select_jobs_from_args(self, args):
"""Select jobs with the given command line arguments ('-j/-f/--doc-filter/--job-id')."""
if (
not args.func == self._main_exec
and args.job_id
and (args.filter or args.doc_filter)
):
"""Select jobs with the given command line arguments ('-j/-f/--job-id')."""
if not args.func == self._main_exec and args.job_id and (args.filter):
raise ValueError(
"Cannot provide both -j/--job-id and -f/--filter or --doc-filter in combination."
"Cannot provide both -j/--job-id and -f/--filter in combination."
)

if args.job_id:
Expand All @@ -4900,12 +4889,11 @@ def _select_jobs_from_args(self, args):
elif args.func == self._main_exec:
# exec command does not support filters, so we must exit early.
return _AggregateStoresCursor(self)
elif args.filter or args.doc_filter:
# filter or doc_filter provided. Filters can only be used to select
elif args.filter:
# filter, including doc_filter provided. Filters can only be used to select
# single jobs and not aggregates of multiple jobs.
filter_ = parse_filter_arg(args.filter)
doc_filter = parse_filter_arg(args.doc_filter)
return _JobAggregateCursor(self, filter_, doc_filter)
return _JobAggregateCursor(self, filter_)
else:
# Use all aggregates
return _AggregateStoresCursor(self)
Expand Down