File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ elif [ "$1" = "query" ]; then
3737 # query [options] FILE
3838 # we dispatch to a script that inspects metadata and emulates the following call:
3939 # bq query [options] < FILE
40+ if [ " $# " -lt 2 ]; then
41+ echo " Error: 'query' command requires at least one argument (FILE)" >&2
42+ exit 1
43+ fi
4044 exec script/bqetl query run " ${@: -1} " " ${@: 1: $# -1} "
4145elif [ " $XCOM_PUSH " = " true" ]; then
4246 # KubernetesPodOperator will extract the contents of /airflow/xcom/return.json as an xcom
Original file line number Diff line number Diff line change @@ -137,4 +137,7 @@ def test_run_query_no_query_file(self):
137137 check = True ,
138138 capture_output = True ,
139139 )
140- assert b"No queries matching" in e .value .stderr
140+ assert (
141+ b"Error: 'query' command requires at least one argument (FILE)"
142+ in e .value .stderr
143+ )
You can’t perform that action at this time.
0 commit comments