Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings location in google provider #16403

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion airflow/providers/google/cloud/operators/bigquery.py
Expand Up @@ -640,12 +640,14 @@ def __init__(
"The bigquery_conn_id parameter has been deprecated. You should pass "
"the gcp_conn_id parameter.",
DeprecationWarning,
stacklevel=2,
)
gcp_conn_id = bigquery_conn_id

warnings.warn(
"This operator is deprecated. Please use `BigQueryInsertJobOperator`.",
DeprecationWarning,
stacklevel=2,
)

self.sql = sql
Expand Down Expand Up @@ -1638,7 +1640,7 @@ def __init__(
warnings.warn(
"This operator is deprecated. Please use BigQueryUpdateDatasetOperator.",
DeprecationWarning,
stacklevel=3,
stacklevel=2,
)
self.dataset_id = dataset_id
self.project_id = project_id
Expand Down
12 changes: 10 additions & 2 deletions airflow/providers/google/cloud/transfers/gdrive_to_gcs.py
Expand Up @@ -93,10 +93,18 @@ def __init__(
super().__init__(**kwargs)
self.bucket_name = destination_bucket or bucket_name
if destination_bucket:
warnings.warn("`destination_bucket` is deprecated please use `bucket_name`", DeprecationWarning)
warnings.warn(
"`destination_bucket` is deprecated please use `bucket_name`",
DeprecationWarning,
stacklevel=2,
)
self.object_name = destination_object or object_name
if destination_object:
warnings.warn("`destination_object` is deprecated please use `object_name`", DeprecationWarning)
warnings.warn(
"`destination_object` is deprecated please use `object_name`",
DeprecationWarning,
stacklevel=2,
)
self.folder_id = folder_id
self.drive_id = drive_id
self.file_name = file_name
Expand Down