From c649f8b6cd60967c8197dd90d028fc5e57526a13 Mon Sep 17 00:00:00 2001 From: Bingqin Zhou Date: Thu, 8 Aug 2019 14:47:17 -0700 Subject: [PATCH 1/3] Change default of autodetect to be True from False. --- airflow/contrib/hooks/bigquery_hook.py | 2 +- airflow/contrib/operators/gcs_to_bq.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/contrib/hooks/bigquery_hook.py b/airflow/contrib/hooks/bigquery_hook.py index b9ec8c4b827d0..d8fb632bd8dde 100644 --- a/airflow/contrib/hooks/bigquery_hook.py +++ b/airflow/contrib/hooks/bigquery_hook.py @@ -1072,7 +1072,7 @@ def run_load(self, # pylint: disable=too-many-locals,too-many-arguments,invalid src_fmt_configs=None, time_partitioning=None, cluster_fields=None, - autodetect=False, + autodetect=True, encryption_configuration=None): """ Executes a BigQuery load command to load data from Google Cloud Storage diff --git a/airflow/contrib/operators/gcs_to_bq.py b/airflow/contrib/operators/gcs_to_bq.py index 0a8c4978fa903..1806a95a89fe7 100644 --- a/airflow/contrib/operators/gcs_to_bq.py +++ b/airflow/contrib/operators/gcs_to_bq.py @@ -178,7 +178,7 @@ def __init__(self, external_table=False, time_partitioning=None, cluster_fields=None, - autodetect=False, + autodetect=True, encryption_configuration=None, *args, **kwargs): From bf92472a7ed6defbe36fe3f096cef6d2352c0c29 Mon Sep 17 00:00:00 2001 From: Bingqin Zhou Date: Fri, 9 Aug 2019 11:58:19 -0700 Subject: [PATCH 2/3] Change default value to be True in comment. --- airflow/contrib/operators/gcs_to_bq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/contrib/operators/gcs_to_bq.py b/airflow/contrib/operators/gcs_to_bq.py index 1806a95a89fe7..7b811654b3e15 100644 --- a/airflow/contrib/operators/gcs_to_bq.py +++ b/airflow/contrib/operators/gcs_to_bq.py @@ -133,7 +133,7 @@ class GoogleCloudStorageToBigQueryOperator(BaseOperator): Not applicable for external tables. :type cluster_fields: list[str] :param autodetect: [Optional] Indicates if we should automatically infer the - options and schema for CSV and JSON sources. (Default: ``False``). + options and schema for CSV and JSON sources. (Default: ``True``). Parameter must be setted to True if 'schema_fields' and 'schema_object' are undefined. It is suggested to set to True if table are create outside of Airflow. :type autodetect: bool From 076df65ec46f4d1316acf9506a3eee1e1575f1f8 Mon Sep 17 00:00:00 2001 From: Bingqin Zhou Date: Fri, 9 Aug 2019 14:32:46 -0700 Subject: [PATCH 3/3] [AIRFLOW-5152]Change autodetect default value to be true in GoogleCloudStorageToBigQueryOperator. --- airflow/contrib/hooks/bigquery_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/contrib/hooks/bigquery_hook.py b/airflow/contrib/hooks/bigquery_hook.py index d8fb632bd8dde..b9ec8c4b827d0 100644 --- a/airflow/contrib/hooks/bigquery_hook.py +++ b/airflow/contrib/hooks/bigquery_hook.py @@ -1072,7 +1072,7 @@ def run_load(self, # pylint: disable=too-many-locals,too-many-arguments,invalid src_fmt_configs=None, time_partitioning=None, cluster_fields=None, - autodetect=True, + autodetect=False, encryption_configuration=None): """ Executes a BigQuery load command to load data from Google Cloud Storage