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 2023/01/12 10:34:01 UTC
[airflow] branch main updated: `BigQueryCreateExternalTableOperator` fix field delimiter not working with csv (#28856)
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 f1eb2f1af4 `BigQueryCreateExternalTableOperator` fix field delimiter not working with csv (#28856)
f1eb2f1af4 is described below
commit f1eb2f1af42c537f7c49a891f238083fd5d9e762
Author: fhaubner <fh...@users.noreply.github.com>
AuthorDate: Thu Jan 12 11:33:33 2023 +0100
`BigQueryCreateExternalTableOperator` fix field delimiter not working with csv (#28856)
* CSV import: Field delimiter not used
There is a typo when populating the externalDataConfiguration.
Within the csvOptions the property needs to be called "fieldDelimiter"
Documentation of the BigQuery csvOptions: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions
Co-authored-by: Elad Kalif <45...@users.noreply.github.com>
---
airflow/providers/google/cloud/operators/bigquery.py | 2 +-
tests/providers/google/cloud/operators/test_bigquery.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow/providers/google/cloud/operators/bigquery.py b/airflow/providers/google/cloud/operators/bigquery.py
index eeb003eb69..7847629546 100644
--- a/airflow/providers/google/cloud/operators/bigquery.py
+++ b/airflow/providers/google/cloud/operators/bigquery.py
@@ -1631,7 +1631,7 @@ class BigQueryCreateExternalTableOperator(BaseOperator):
"autodetect": self.autodetect,
"compression": self.compression,
"csvOptions": {
- "fieldDelimeter": self.field_delimiter,
+ "fieldDelimiter": self.field_delimiter,
"skipLeadingRows": self.skip_leading_rows,
"quote": self.quote_character,
"allowQuotedNewlines": self.allow_quoted_newlines,
diff --git a/tests/providers/google/cloud/operators/test_bigquery.py b/tests/providers/google/cloud/operators/test_bigquery.py
index 5eab8807a5..d814c894bb 100644
--- a/tests/providers/google/cloud/operators/test_bigquery.py
+++ b/tests/providers/google/cloud/operators/test_bigquery.py
@@ -239,7 +239,7 @@ class TestBigQueryCreateExternalTableOperator(unittest.TestCase):
"autodetect": True,
"compression": "NONE",
"csvOptions": {
- "fieldDelimeter": ",",
+ "fieldDelimiter": ",",
"skipLeadingRows": 0,
"quote": None,
"allowQuotedNewlines": False,