You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by el...@apache.org on 2022/03/06 10:26:27 UTC

[airflow] branch main updated: Add autodetect arg to external table creation in GCSToBigQueryOperator (#21944)

This is an automated email from the ASF dual-hosted git repository.

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9020b3a  Add autodetect arg to external table creation in GCSToBigQueryOperator (#21944)
9020b3a is described below

commit 9020b3a89d4572572c50d6ac0f1724e09092e0b5
Author: Kshitij Shah <43...@users.noreply.github.com>
AuthorDate: Sun Mar 6 15:55:37 2022 +0530

    Add autodetect arg to external table creation in GCSToBigQueryOperator (#21944)
    
    * Added autodetect parameter in external table creation in GCSToBigQueryOperator
---
 airflow/providers/google/cloud/transfers/gcs_to_bigquery.py    | 1 +
 tests/providers/google/cloud/transfers/test_gcs_to_bigquery.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py b/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
index a58f01f..9954aa8 100644
--- a/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
+++ b/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
@@ -273,6 +273,7 @@ class GCSToBigQueryOperator(BaseOperator):
                     schema_fields=schema_fields,
                     source_uris=source_uris,
                     source_format=self.source_format,
+                    autodetect=self.autodetect,
                     compression=self.compression,
                     skip_leading_rows=self.skip_leading_rows,
                     field_delimiter=self.field_delimiter,
diff --git a/tests/providers/google/cloud/transfers/test_gcs_to_bigquery.py b/tests/providers/google/cloud/transfers/test_gcs_to_bigquery.py
index 4330797..4097031 100644
--- a/tests/providers/google/cloud/transfers/test_gcs_to_bigquery.py
+++ b/tests/providers/google/cloud/transfers/test_gcs_to_bigquery.py
@@ -146,6 +146,7 @@ class TestGCSToBigQueryOperator(unittest.TestCase):
             schema_fields=mock.ANY,
             source_uris=mock.ANY,
             source_format=mock.ANY,
+            autodetect=mock.ANY,
             compression=mock.ANY,
             skip_leading_rows=mock.ANY,
             field_delimiter=mock.ANY,
@@ -181,6 +182,7 @@ class TestGCSToBigQueryOperator(unittest.TestCase):
             schema_fields=mock.ANY,
             source_uris=mock.ANY,
             source_format=mock.ANY,
+            autodetect=mock.ANY,
             compression=mock.ANY,
             skip_leading_rows=mock.ANY,
             field_delimiter=mock.ANY,