The correct argument for exporting JSON should be NEWLINE_DELIMITED_JSON, which is implicit in the current yaml template. If you actually pass JSON to the export_format field, Airflow will automatically correct it into the default value CSV and you will get unexpected result even when you think you set the "correct" argument here.
Hereby we use the enum to replace the original plain string to enforce the argument check at the first place, so that you won't be confused by the automatic fallback to CSV.
People would easily make mistakes if they replace
CSV
withJSON
in the export_format becauseJSON
is not in the allowed format list.https://github.com/apache/airflow/blob/1.10.3/airflow/contrib/hooks/bigquery_hook.py#L1096-L1098
The correct argument for exporting JSON should be
NEWLINE_DELIMITED_JSON
, which is implicit in the current yaml template. If you actually passJSON
to theexport_format
field, Airflow will automatically correct it into the default valueCSV
and you will get unexpected result even when you think you set the "correct" argument here.Hereby we use the enum to replace the original plain string to enforce the argument check at the first place, so that you won't be confused by the automatic fallback to CSV.