Skip to content

Commit

Permalink
Update BigQueryCreateExternalTableOperator doc and parameters (#18676)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnyz committed Oct 28, 2021
1 parent 60fade2 commit e4aa377
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@
"sourceUris": [DATA_SAMPLE_GCS_URL],
},
},
bucket=DATA_SAMPLE_GCS_BUCKET_NAME,
source_objects=[DATA_SAMPLE_GCS_OBJECT_NAME],
)
# [END howto_operator_bigquery_create_external_table]

Expand Down
11 changes: 7 additions & 4 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,8 @@ class BigQueryCreateExternalTableOperator(BaseOperator):
def __init__(
self,
*,
bucket: str,
source_objects: List,
bucket: Optional[str] = None,
source_objects: Optional[List] = None,
destination_project_dataset_table: str = None,
table_resource: Optional[Dict[str, Any]] = None,
schema_fields: Optional[List] = None,
Expand Down Expand Up @@ -1142,11 +1142,14 @@ def __init__(
if not table_resource:
warnings.warn(
"Passing table parameters via keywords arguments will be deprecated. "
"Please use provide table definition using `table_resource` parameter."
"You can still use external `schema_object`. ",
"Please use provide table definition using `table_resource` parameter.",
DeprecationWarning,
stacklevel=2,
)
if not bucket:
raise ValueError("`bucket` is required when not using `table_resource`.")
if not source_objects:
raise ValueError("`source_objects` is required when not using `table_resource`.")
if not source_format:
source_format = 'CSV'
if not compression:
Expand Down

0 comments on commit e4aa377

Please sign in to comment.