apache-airflow-providers-google 10.26.0rc1__py3-none-any.whl → 11.0.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airflow/providers/google/__init__.py +1 -1
- airflow/providers/google/ads/hooks/ads.py +2 -1
- airflow/providers/google/ads/operators/ads.py +2 -1
- airflow/providers/google/ads/transfers/ads_to_gcs.py +2 -1
- airflow/providers/google/assets/gcs.py +17 -1
- airflow/providers/google/cloud/hooks/automl.py +3 -6
- airflow/providers/google/cloud/hooks/bigquery.py +41 -1486
- airflow/providers/google/cloud/hooks/bigquery_dts.py +4 -11
- airflow/providers/google/cloud/hooks/bigtable.py +3 -6
- airflow/providers/google/cloud/hooks/cloud_batch.py +6 -3
- airflow/providers/google/cloud/hooks/cloud_build.py +3 -15
- airflow/providers/google/cloud/hooks/cloud_composer.py +2 -17
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +5 -6
- airflow/providers/google/cloud/hooks/cloud_run.py +10 -5
- airflow/providers/google/cloud/hooks/cloud_sql.py +5 -7
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +3 -7
- airflow/providers/google/cloud/hooks/compute.py +3 -6
- airflow/providers/google/cloud/hooks/compute_ssh.py +0 -5
- airflow/providers/google/cloud/hooks/datacatalog.py +3 -6
- airflow/providers/google/cloud/hooks/dataflow.py +3 -14
- airflow/providers/google/cloud/hooks/dataform.py +2 -9
- airflow/providers/google/cloud/hooks/datafusion.py +4 -15
- airflow/providers/google/cloud/hooks/dataplex.py +4 -7
- airflow/providers/google/cloud/hooks/dataprep.py +2 -2
- airflow/providers/google/cloud/hooks/dataproc.py +77 -22
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +2 -9
- airflow/providers/google/cloud/hooks/datastore.py +3 -6
- airflow/providers/google/cloud/hooks/dlp.py +3 -6
- airflow/providers/google/cloud/hooks/functions.py +2 -6
- airflow/providers/google/cloud/hooks/gcs.py +2 -18
- airflow/providers/google/cloud/hooks/gdm.py +1 -17
- airflow/providers/google/cloud/hooks/kms.py +3 -6
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +7 -97
- airflow/providers/google/cloud/hooks/life_sciences.py +2 -6
- airflow/providers/google/cloud/hooks/looker.py +2 -1
- airflow/providers/google/cloud/hooks/mlengine.py +0 -8
- airflow/providers/google/cloud/hooks/natural_language.py +3 -6
- airflow/providers/google/cloud/hooks/os_login.py +3 -6
- airflow/providers/google/cloud/hooks/pubsub.py +3 -6
- airflow/providers/google/cloud/hooks/secret_manager.py +3 -73
- airflow/providers/google/cloud/hooks/spanner.py +3 -6
- airflow/providers/google/cloud/hooks/speech_to_text.py +3 -6
- airflow/providers/google/cloud/hooks/stackdriver.py +3 -6
- airflow/providers/google/cloud/hooks/tasks.py +3 -6
- airflow/providers/google/cloud/hooks/text_to_speech.py +3 -6
- airflow/providers/google/cloud/hooks/translate.py +455 -9
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +3 -6
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +3 -6
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +3 -6
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +2 -9
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +2 -9
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +1 -14
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +3 -6
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +2 -9
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +3 -1
- airflow/providers/google/cloud/hooks/vertex_ai/prediction_service.py +2 -1
- airflow/providers/google/cloud/hooks/video_intelligence.py +3 -6
- airflow/providers/google/cloud/hooks/vision.py +3 -6
- airflow/providers/google/cloud/hooks/workflows.py +2 -9
- airflow/providers/google/cloud/links/dataproc.py +0 -1
- airflow/providers/google/cloud/links/translate.py +91 -0
- airflow/providers/google/cloud/log/gcs_task_handler.py +2 -1
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +11 -3
- airflow/providers/google/cloud/openlineage/utils.py +54 -21
- airflow/providers/google/cloud/operators/automl.py +5 -4
- airflow/providers/google/cloud/operators/bigquery.py +2 -341
- airflow/providers/google/cloud/operators/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/operators/bigtable.py +2 -1
- airflow/providers/google/cloud/operators/cloud_batch.py +2 -1
- airflow/providers/google/cloud/operators/cloud_build.py +2 -1
- airflow/providers/google/cloud/operators/cloud_composer.py +2 -1
- airflow/providers/google/cloud/operators/cloud_memorystore.py +2 -1
- airflow/providers/google/cloud/operators/cloud_run.py +2 -1
- airflow/providers/google/cloud/operators/cloud_sql.py +2 -1
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +2 -1
- airflow/providers/google/cloud/operators/compute.py +2 -1
- airflow/providers/google/cloud/operators/datacatalog.py +2 -1
- airflow/providers/google/cloud/operators/dataflow.py +2 -517
- airflow/providers/google/cloud/operators/dataform.py +2 -1
- airflow/providers/google/cloud/operators/datafusion.py +2 -1
- airflow/providers/google/cloud/operators/dataplex.py +37 -31
- airflow/providers/google/cloud/operators/dataprep.py +2 -1
- airflow/providers/google/cloud/operators/dataproc.py +3 -633
- airflow/providers/google/cloud/operators/dataproc_metastore.py +2 -1
- airflow/providers/google/cloud/operators/datastore.py +2 -1
- airflow/providers/google/cloud/operators/dlp.py +2 -1
- airflow/providers/google/cloud/operators/functions.py +2 -1
- airflow/providers/google/cloud/operators/gcs.py +5 -4
- airflow/providers/google/cloud/operators/kubernetes_engine.py +2 -11
- airflow/providers/google/cloud/operators/life_sciences.py +2 -1
- airflow/providers/google/cloud/operators/mlengine.py +2 -1
- airflow/providers/google/cloud/operators/natural_language.py +3 -2
- airflow/providers/google/cloud/operators/pubsub.py +2 -1
- airflow/providers/google/cloud/operators/spanner.py +2 -1
- airflow/providers/google/cloud/operators/speech_to_text.py +2 -1
- airflow/providers/google/cloud/operators/stackdriver.py +2 -1
- airflow/providers/google/cloud/operators/tasks.py +3 -2
- airflow/providers/google/cloud/operators/text_to_speech.py +2 -1
- airflow/providers/google/cloud/operators/translate.py +622 -32
- airflow/providers/google/cloud/operators/translate_speech.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +2 -93
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +3 -13
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +2 -17
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/generative_model.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +3 -13
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +2 -1
- airflow/providers/google/cloud/operators/video_intelligence.py +2 -1
- airflow/providers/google/cloud/operators/vision.py +3 -2
- airflow/providers/google/cloud/operators/workflows.py +3 -2
- airflow/providers/google/cloud/secrets/secret_manager.py +2 -19
- airflow/providers/google/cloud/sensors/bigquery.py +2 -81
- airflow/providers/google/cloud/sensors/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/sensors/bigtable.py +2 -1
- airflow/providers/google/cloud/sensors/cloud_composer.py +8 -94
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +2 -1
- airflow/providers/google/cloud/sensors/dataflow.py +2 -1
- airflow/providers/google/cloud/sensors/dataform.py +2 -1
- airflow/providers/google/cloud/sensors/datafusion.py +2 -1
- airflow/providers/google/cloud/sensors/dataplex.py +2 -1
- airflow/providers/google/cloud/sensors/dataprep.py +2 -1
- airflow/providers/google/cloud/sensors/dataproc.py +2 -1
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +2 -1
- airflow/providers/google/cloud/sensors/gcs.py +4 -36
- airflow/providers/google/cloud/sensors/pubsub.py +2 -1
- airflow/providers/google/cloud/sensors/tasks.py +2 -1
- airflow/providers/google/cloud/sensors/workflows.py +2 -1
- airflow/providers/google/cloud/transfers/adls_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/azure_blob_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +75 -18
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +9 -7
- airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +2 -1
- airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +1 -1
- airflow/providers/google/cloud/transfers/bigquery_to_sql.py +2 -1
- airflow/providers/google/cloud/transfers/calendar_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +13 -9
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/gcs_to_local.py +2 -1
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +2 -1
- airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/gdrive_to_local.py +2 -1
- airflow/providers/google/cloud/transfers/local_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/mssql_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/salesforce_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/sheets_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +2 -1
- airflow/providers/google/cloud/triggers/bigquery.py +2 -1
- airflow/providers/google/cloud/triggers/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_batch.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_build.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_composer.py +3 -2
- airflow/providers/google/cloud/triggers/cloud_run.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_sql.py +1 -1
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +2 -1
- airflow/providers/google/cloud/triggers/dataflow.py +2 -1
- airflow/providers/google/cloud/triggers/datafusion.py +2 -1
- airflow/providers/google/cloud/triggers/dataplex.py +1 -1
- airflow/providers/google/cloud/triggers/dataproc.py +2 -1
- airflow/providers/google/cloud/triggers/gcs.py +3 -2
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +2 -1
- airflow/providers/google/cloud/triggers/mlengine.py +2 -1
- airflow/providers/google/cloud/triggers/pubsub.py +2 -1
- airflow/providers/google/cloud/triggers/vertex_ai.py +2 -1
- airflow/providers/google/cloud/utils/credentials_provider.py +1 -1
- airflow/providers/google/cloud/utils/dataform.py +1 -1
- airflow/providers/google/cloud/utils/field_validator.py +2 -1
- airflow/providers/google/cloud/utils/mlengine_operator_utils.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +4 -11
- airflow/providers/google/common/hooks/discovery_api.py +1 -6
- airflow/providers/google/firebase/hooks/firestore.py +1 -1
- airflow/providers/google/firebase/operators/firestore.py +2 -1
- airflow/providers/google/get_provider_info.py +7 -22
- airflow/providers/google/marketing_platform/hooks/analytics_admin.py +2 -1
- airflow/providers/google/marketing_platform/hooks/campaign_manager.py +2 -3
- airflow/providers/google/marketing_platform/hooks/display_video.py +4 -3
- airflow/providers/google/marketing_platform/hooks/search_ads.py +6 -6
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +2 -1
- airflow/providers/google/marketing_platform/operators/campaign_manager.py +2 -42
- airflow/providers/google/marketing_platform/operators/display_video.py +2 -47
- airflow/providers/google/marketing_platform/operators/search_ads.py +2 -1
- airflow/providers/google/marketing_platform/sensors/campaign_manager.py +2 -7
- airflow/providers/google/marketing_platform/sensors/display_video.py +2 -13
- airflow/providers/google/suite/hooks/calendar.py +2 -8
- airflow/providers/google/suite/hooks/drive.py +2 -6
- airflow/providers/google/suite/hooks/sheets.py +2 -7
- airflow/providers/google/suite/operators/sheets.py +2 -7
- airflow/providers/google/suite/sensors/drive.py +2 -7
- airflow/providers/google/suite/transfers/gcs_to_gdrive.py +2 -7
- airflow/providers/google/suite/transfers/gcs_to_sheets.py +2 -7
- airflow/providers/google/suite/transfers/local_to_drive.py +2 -7
- airflow/providers/google/suite/transfers/sql_to_sheets.py +2 -7
- {apache_airflow_providers_google-10.26.0rc1.dist-info → apache_airflow_providers_google-11.0.0rc1.dist-info}/METADATA +10 -10
- apache_airflow_providers_google-11.0.0rc1.dist-info/RECORD +315 -0
- airflow/providers/google/marketing_platform/hooks/analytics.py +0 -211
- airflow/providers/google/marketing_platform/operators/analytics.py +0 -551
- apache_airflow_providers_google-10.26.0rc1.dist-info/RECORD +0 -317
- {apache_airflow_providers_google-10.26.0rc1.dist-info → apache_airflow_providers_google-11.0.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-10.26.0rc1.dist-info → apache_airflow_providers_google-11.0.0rc1.dist-info}/entry_points.txt +0 -0
@@ -19,8 +19,9 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
+
from collections.abc import Sequence
|
22
23
|
from copy import copy
|
23
|
-
from typing import TYPE_CHECKING
|
24
|
+
from typing import TYPE_CHECKING
|
24
25
|
|
25
26
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
26
27
|
from google.cloud.bigquery_datatransfer_v1 import DataTransferServiceAsyncClient, DataTransferServiceClient
|
@@ -65,14 +66,10 @@ class BiqQueryDataTransferServiceHook(GoogleBaseHook):
|
|
65
66
|
impersonation_chain: str | Sequence[str] | None = None,
|
66
67
|
**kwargs,
|
67
68
|
) -> None:
|
68
|
-
if kwargs.get("delegate_to") is not None:
|
69
|
-
raise RuntimeError(
|
70
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
71
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
72
|
-
)
|
73
69
|
super().__init__(
|
74
70
|
gcp_conn_id=gcp_conn_id,
|
75
71
|
impersonation_chain=impersonation_chain,
|
72
|
+
**kwargs,
|
76
73
|
)
|
77
74
|
self.location = location
|
78
75
|
|
@@ -291,15 +288,11 @@ class AsyncBiqQueryDataTransferServiceHook(GoogleBaseAsyncHook):
|
|
291
288
|
impersonation_chain: str | Sequence[str] | None = None,
|
292
289
|
**kwargs,
|
293
290
|
):
|
294
|
-
if kwargs.get("delegate_to") is not None:
|
295
|
-
raise RuntimeError(
|
296
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
297
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
298
|
-
)
|
299
291
|
super().__init__(
|
300
292
|
gcp_conn_id=gcp_conn_id,
|
301
293
|
location=location,
|
302
294
|
impersonation_chain=impersonation_chain,
|
295
|
+
**kwargs,
|
303
296
|
)
|
304
297
|
self._conn: DataTransferServiceAsyncClient | None = None
|
305
298
|
|
@@ -19,7 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from
|
22
|
+
from collections.abc import Sequence
|
23
|
+
from typing import TYPE_CHECKING
|
23
24
|
|
24
25
|
from google.cloud.bigtable import Client, enums
|
25
26
|
from google.cloud.bigtable.cluster import Cluster
|
@@ -49,14 +50,10 @@ class BigtableHook(GoogleBaseHook):
|
|
49
50
|
impersonation_chain: str | Sequence[str] | None = None,
|
50
51
|
**kwargs,
|
51
52
|
) -> None:
|
52
|
-
if kwargs.get("delegate_to") is not None:
|
53
|
-
raise RuntimeError(
|
54
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
55
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
56
|
-
)
|
57
53
|
super().__init__(
|
58
54
|
gcp_conn_id=gcp_conn_id,
|
59
55
|
impersonation_chain=impersonation_chain,
|
56
|
+
**kwargs,
|
60
57
|
)
|
61
58
|
self._client: Client | None = None
|
62
59
|
|
@@ -20,7 +20,8 @@ from __future__ import annotations
|
|
20
20
|
import itertools
|
21
21
|
import json
|
22
22
|
import time
|
23
|
-
from
|
23
|
+
from collections.abc import Iterable, Sequence
|
24
|
+
from typing import TYPE_CHECKING
|
24
25
|
|
25
26
|
from google.cloud.batch import ListJobsRequest, ListTasksRequest
|
26
27
|
from google.cloud.batch_v1 import (
|
@@ -60,8 +61,9 @@ class CloudBatchHook(GoogleBaseHook):
|
|
60
61
|
self,
|
61
62
|
gcp_conn_id: str = "google_cloud_default",
|
62
63
|
impersonation_chain: str | Sequence[str] | None = None,
|
64
|
+
**kwargs,
|
63
65
|
) -> None:
|
64
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
66
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
65
67
|
self._client: BatchServiceClient | None = None
|
66
68
|
|
67
69
|
def get_conn(self):
|
@@ -183,9 +185,10 @@ class CloudBatchAsyncHook(GoogleBaseHook):
|
|
183
185
|
self,
|
184
186
|
gcp_conn_id: str = "google_cloud_default",
|
185
187
|
impersonation_chain: str | Sequence[str] | None = None,
|
188
|
+
**kwargs,
|
186
189
|
):
|
187
190
|
self._client: BatchServiceAsyncClient | None = None
|
188
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
191
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
189
192
|
|
190
193
|
def get_conn(self):
|
191
194
|
if self._client is None:
|
@@ -19,7 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from
|
22
|
+
from collections.abc import Sequence
|
23
|
+
from typing import TYPE_CHECKING
|
23
24
|
|
24
25
|
from google.api_core.client_options import ClientOptions
|
25
26
|
from google.api_core.exceptions import AlreadyExists
|
@@ -62,12 +63,7 @@ class CloudBuildHook(GoogleBaseHook):
|
|
62
63
|
impersonation_chain: str | Sequence[str] | None = None,
|
63
64
|
**kwargs,
|
64
65
|
) -> None:
|
65
|
-
|
66
|
-
raise RuntimeError(
|
67
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
68
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
69
|
-
)
|
70
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
66
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
71
67
|
self._client: dict[str, CloudBuildClient] = {}
|
72
68
|
|
73
69
|
def _get_build_id_from_operation(self, operation: Operation) -> str:
|
@@ -634,14 +630,6 @@ class CloudBuildHook(GoogleBaseHook):
|
|
634
630
|
class CloudBuildAsyncHook(GoogleBaseHook):
|
635
631
|
"""Asynchronous Hook for the Google Cloud Build Service."""
|
636
632
|
|
637
|
-
def __init__(self, **kwargs):
|
638
|
-
if kwargs.get("delegate_to") is not None:
|
639
|
-
raise RuntimeError(
|
640
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
641
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
642
|
-
)
|
643
|
-
super().__init__(**kwargs)
|
644
|
-
|
645
633
|
@GoogleBaseHook.fallback_to_default_project_id
|
646
634
|
async def get_cloud_build(
|
647
635
|
self,
|
@@ -19,7 +19,8 @@ from __future__ import annotations
|
|
19
19
|
|
20
20
|
import asyncio
|
21
21
|
import time
|
22
|
-
from
|
22
|
+
from collections.abc import MutableSequence, Sequence
|
23
|
+
from typing import TYPE_CHECKING
|
23
24
|
|
24
25
|
from google.api_core.client_options import ClientOptions
|
25
26
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
@@ -57,14 +58,6 @@ class CloudComposerHook(GoogleBaseHook):
|
|
57
58
|
|
58
59
|
client_options = ClientOptions(api_endpoint="composer.googleapis.com:443")
|
59
60
|
|
60
|
-
def __init__(self, **kwargs):
|
61
|
-
if kwargs.get("delegate_to") is not None:
|
62
|
-
raise RuntimeError(
|
63
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
64
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
65
|
-
)
|
66
|
-
super().__init__(**kwargs)
|
67
|
-
|
68
61
|
def get_environment_client(self) -> EnvironmentsClient:
|
69
62
|
"""Retrieve client library object that allow access Environments service."""
|
70
63
|
return EnvironmentsClient(
|
@@ -425,14 +418,6 @@ class CloudComposerHook(GoogleBaseHook):
|
|
425
418
|
class CloudComposerAsyncHook(GoogleBaseHook):
|
426
419
|
"""Hook for Google Cloud Composer async APIs."""
|
427
420
|
|
428
|
-
def __init__(self, **kwargs):
|
429
|
-
if kwargs.get("delegate_to") is not None:
|
430
|
-
raise RuntimeError(
|
431
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
432
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
433
|
-
)
|
434
|
-
super().__init__(**kwargs)
|
435
|
-
|
436
421
|
client_options = ClientOptions(api_endpoint="composer.googleapis.com:443")
|
437
422
|
|
438
423
|
def get_environment_client(self) -> EnvironmentsAsyncClient:
|
@@ -28,7 +28,8 @@ Hooks for Cloud Memorystore service.
|
|
28
28
|
|
29
29
|
from __future__ import annotations
|
30
30
|
|
31
|
-
from
|
31
|
+
from collections.abc import Sequence
|
32
|
+
from typing import TYPE_CHECKING
|
32
33
|
|
33
34
|
from google.api_core import path_template
|
34
35
|
from google.api_core.exceptions import NotFound
|
@@ -76,14 +77,10 @@ class CloudMemorystoreHook(GoogleBaseHook):
|
|
76
77
|
impersonation_chain: str | Sequence[str] | None = None,
|
77
78
|
**kwargs,
|
78
79
|
) -> None:
|
79
|
-
if kwargs.get("delegate_to") is not None:
|
80
|
-
raise RuntimeError(
|
81
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
82
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
83
|
-
)
|
84
80
|
super().__init__(
|
85
81
|
gcp_conn_id=gcp_conn_id,
|
86
82
|
impersonation_chain=impersonation_chain,
|
83
|
+
**kwargs,
|
87
84
|
)
|
88
85
|
self._client: CloudRedisClient | None = None
|
89
86
|
|
@@ -512,10 +509,12 @@ class CloudMemorystoreMemcachedHook(GoogleBaseHook):
|
|
512
509
|
self,
|
513
510
|
gcp_conn_id: str = "google_cloud_default",
|
514
511
|
impersonation_chain: str | Sequence[str] | None = None,
|
512
|
+
**kwargs,
|
515
513
|
) -> None:
|
516
514
|
super().__init__(
|
517
515
|
gcp_conn_id=gcp_conn_id,
|
518
516
|
impersonation_chain=impersonation_chain,
|
517
|
+
**kwargs,
|
519
518
|
)
|
520
519
|
self._client: CloudMemcacheClient | None = None
|
521
520
|
|
@@ -18,7 +18,8 @@
|
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
20
|
import itertools
|
21
|
-
from
|
21
|
+
from collections.abc import Iterable, Sequence
|
22
|
+
from typing import TYPE_CHECKING, Any
|
22
23
|
|
23
24
|
from google.cloud.run_v2 import (
|
24
25
|
CreateJobRequest,
|
@@ -68,8 +69,9 @@ class CloudRunHook(GoogleBaseHook):
|
|
68
69
|
self,
|
69
70
|
gcp_conn_id: str = "google_cloud_default",
|
70
71
|
impersonation_chain: str | Sequence[str] | None = None,
|
72
|
+
**kwargs,
|
71
73
|
) -> None:
|
72
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
74
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
73
75
|
self._client: JobsClient | None = None
|
74
76
|
|
75
77
|
def get_conn(self):
|
@@ -176,9 +178,10 @@ class CloudRunAsyncHook(GoogleBaseHook):
|
|
176
178
|
self,
|
177
179
|
gcp_conn_id: str = "google_cloud_default",
|
178
180
|
impersonation_chain: str | Sequence[str] | None = None,
|
181
|
+
**kwargs,
|
179
182
|
):
|
180
183
|
self._client: JobsAsyncClient | None = None
|
181
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
184
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
182
185
|
|
183
186
|
def get_conn(self):
|
184
187
|
if self._client is None:
|
@@ -211,9 +214,10 @@ class CloudRunServiceHook(GoogleBaseHook):
|
|
211
214
|
self,
|
212
215
|
gcp_conn_id: str = "google_cloud_default",
|
213
216
|
impersonation_chain: str | Sequence[str] | None = None,
|
217
|
+
**kwargs,
|
214
218
|
):
|
215
219
|
self._client: ServicesClient | None = None
|
216
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
220
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
217
221
|
|
218
222
|
def get_conn(self):
|
219
223
|
if self._client is None:
|
@@ -273,9 +277,10 @@ class CloudRunServiceAsyncHook(GoogleBaseHook):
|
|
273
277
|
self,
|
274
278
|
gcp_conn_id: str = "google_cloud_default",
|
275
279
|
impersonation_chain: str | Sequence[str] | None = None,
|
280
|
+
**kwargs,
|
276
281
|
):
|
277
282
|
self._client: ServicesClient | None = None
|
278
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
283
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
279
284
|
|
280
285
|
def get_conn(self):
|
281
286
|
if self._client is None:
|
@@ -33,11 +33,12 @@ import string
|
|
33
33
|
import subprocess
|
34
34
|
import time
|
35
35
|
import uuid
|
36
|
+
from collections.abc import Sequence
|
36
37
|
from inspect import signature
|
37
38
|
from pathlib import Path
|
38
39
|
from subprocess import PIPE, Popen
|
39
40
|
from tempfile import NamedTemporaryFile, _TemporaryFileWrapper, gettempdir
|
40
|
-
from typing import TYPE_CHECKING, Any
|
41
|
+
from typing import TYPE_CHECKING, Any
|
41
42
|
from urllib.parse import quote_plus
|
42
43
|
|
43
44
|
import httpx
|
@@ -108,14 +109,10 @@ class CloudSQLHook(GoogleBaseHook):
|
|
108
109
|
impersonation_chain: str | Sequence[str] | None = None,
|
109
110
|
**kwargs,
|
110
111
|
) -> None:
|
111
|
-
if kwargs.get("delegate_to") is not None:
|
112
|
-
raise RuntimeError(
|
113
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
114
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
115
|
-
)
|
116
112
|
super().__init__(
|
117
113
|
gcp_conn_id=gcp_conn_id,
|
118
114
|
impersonation_chain=impersonation_chain,
|
115
|
+
**kwargs,
|
119
116
|
)
|
120
117
|
self.api_version = api_version
|
121
118
|
self._conn = None
|
@@ -828,8 +825,9 @@ class CloudSQLDatabaseHook(BaseHook):
|
|
828
825
|
ssl_key: str | None = None,
|
829
826
|
ssl_root_cert: str | None = None,
|
830
827
|
ssl_secret_id: str | None = None,
|
828
|
+
**kwargs,
|
831
829
|
) -> None:
|
832
|
-
super().__init__()
|
830
|
+
super().__init__(**kwargs)
|
833
831
|
self.gcp_conn_id = gcp_conn_id
|
834
832
|
self.gcp_cloudsql_conn_id = gcp_cloudsql_conn_id
|
835
833
|
self.impersonation_chain = impersonation_chain
|
@@ -31,9 +31,10 @@ import json
|
|
31
31
|
import logging
|
32
32
|
import time
|
33
33
|
import warnings
|
34
|
+
from collections.abc import Sequence
|
34
35
|
from copy import deepcopy
|
35
36
|
from datetime import timedelta
|
36
|
-
from typing import TYPE_CHECKING, Any
|
37
|
+
from typing import TYPE_CHECKING, Any
|
37
38
|
|
38
39
|
from google.cloud.storage_transfer_v1 import (
|
39
40
|
ListTransferJobsRequest,
|
@@ -159,15 +160,10 @@ class CloudDataTransferServiceHook(GoogleBaseHook):
|
|
159
160
|
impersonation_chain: str | Sequence[str] | None = None,
|
160
161
|
**kwargs,
|
161
162
|
) -> None:
|
162
|
-
if "delegate_to" in kwargs:
|
163
|
-
raise RuntimeError(
|
164
|
-
"The `delegate_to` parameter has been deprecated before and "
|
165
|
-
"finally removed in this version of Google Provider. You MUST "
|
166
|
-
"convert it to `impersonate_chain`."
|
167
|
-
)
|
168
163
|
super().__init__(
|
169
164
|
gcp_conn_id=gcp_conn_id,
|
170
165
|
impersonation_chain=impersonation_chain,
|
166
|
+
**kwargs,
|
171
167
|
)
|
172
168
|
self.api_version = api_version
|
173
169
|
self._conn = None
|
@@ -20,7 +20,8 @@
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
22
|
import time
|
23
|
-
from
|
23
|
+
from collections.abc import Sequence
|
24
|
+
from typing import TYPE_CHECKING, Any
|
24
25
|
|
25
26
|
from google.cloud.compute_v1.services.instance_group_managers import InstanceGroupManagersClient
|
26
27
|
from google.cloud.compute_v1.services.instance_templates import InstanceTemplatesClient
|
@@ -61,14 +62,10 @@ class ComputeEngineHook(GoogleBaseHook):
|
|
61
62
|
impersonation_chain: str | Sequence[str] | None = None,
|
62
63
|
**kwargs,
|
63
64
|
) -> None:
|
64
|
-
if kwargs.get("delegate_to") is not None:
|
65
|
-
raise RuntimeError(
|
66
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
67
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
68
|
-
)
|
69
65
|
super().__init__(
|
70
66
|
gcp_conn_id=gcp_conn_id,
|
71
67
|
impersonation_chain=impersonation_chain,
|
68
|
+
**kwargs,
|
72
69
|
)
|
73
70
|
self.api_version = api_version
|
74
71
|
|
@@ -121,11 +121,6 @@ class ComputeEngineSSHHook(SSHHook):
|
|
121
121
|
impersonation_chain: str | None = None,
|
122
122
|
**kwargs,
|
123
123
|
) -> None:
|
124
|
-
if kwargs.get("delegate_to") is not None:
|
125
|
-
raise RuntimeError(
|
126
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
127
|
-
" of Google Provider. You MUST convert it to `impersonation_chain`"
|
128
|
-
)
|
129
124
|
# Ignore original constructor
|
130
125
|
# super().__init__()
|
131
126
|
self.gcp_conn_id = gcp_conn_id
|
@@ -16,7 +16,8 @@
|
|
16
16
|
# under the License.
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
from
|
19
|
+
from collections.abc import Sequence
|
20
|
+
from typing import TYPE_CHECKING
|
20
21
|
|
21
22
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
22
23
|
from google.cloud import datacatalog
|
@@ -61,14 +62,10 @@ class CloudDataCatalogHook(GoogleBaseHook):
|
|
61
62
|
impersonation_chain: str | Sequence[str] | None = None,
|
62
63
|
**kwargs,
|
63
64
|
) -> None:
|
64
|
-
if kwargs.get("delegate_to") is not None:
|
65
|
-
raise RuntimeError(
|
66
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
67
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
68
|
-
)
|
69
65
|
super().__init__(
|
70
66
|
gcp_conn_id=gcp_conn_id,
|
71
67
|
impersonation_chain=impersonation_chain,
|
68
|
+
**kwargs,
|
72
69
|
)
|
73
70
|
self._client: DataCatalogClient | None = None
|
74
71
|
|
@@ -27,8 +27,9 @@ import subprocess
|
|
27
27
|
import time
|
28
28
|
import uuid
|
29
29
|
import warnings
|
30
|
+
from collections.abc import Generator, Sequence
|
30
31
|
from copy import deepcopy
|
31
|
-
from typing import TYPE_CHECKING, Any, Callable,
|
32
|
+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
|
32
33
|
|
33
34
|
from google.cloud.dataflow_v1beta3 import (
|
34
35
|
GetJobRequest,
|
@@ -562,11 +563,6 @@ class DataflowHook(GoogleBaseHook):
|
|
562
563
|
expected_terminal_state: str | None = None,
|
563
564
|
**kwargs,
|
564
565
|
) -> None:
|
565
|
-
if kwargs.get("delegate_to") is not None:
|
566
|
-
raise RuntimeError(
|
567
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
568
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
569
|
-
)
|
570
566
|
self.poll_sleep = poll_sleep
|
571
567
|
self.drain_pipeline = drain_pipeline
|
572
568
|
self.cancel_timeout = cancel_timeout
|
@@ -577,6 +573,7 @@ class DataflowHook(GoogleBaseHook):
|
|
577
573
|
super().__init__(
|
578
574
|
gcp_conn_id=gcp_conn_id,
|
579
575
|
impersonation_chain=impersonation_chain,
|
576
|
+
**kwargs,
|
580
577
|
)
|
581
578
|
|
582
579
|
def get_conn(self) -> Resource:
|
@@ -1565,14 +1562,6 @@ class AsyncDataflowHook(GoogleBaseAsyncHook):
|
|
1565
1562
|
|
1566
1563
|
sync_hook_class = DataflowHook
|
1567
1564
|
|
1568
|
-
def __init__(self, **kwargs):
|
1569
|
-
if kwargs.get("delegate_to") is not None:
|
1570
|
-
raise RuntimeError(
|
1571
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
1572
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
1573
|
-
)
|
1574
|
-
super().__init__(**kwargs)
|
1575
|
-
|
1576
1565
|
async def initialize_client(self, client_class):
|
1577
1566
|
"""
|
1578
1567
|
Initialize object of the given class.
|
@@ -17,7 +17,8 @@
|
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
19
|
import time
|
20
|
-
from
|
20
|
+
from collections.abc import Sequence
|
21
|
+
from typing import TYPE_CHECKING
|
21
22
|
|
22
23
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
23
24
|
from google.cloud.dataform_v1beta1 import DataformClient
|
@@ -41,14 +42,6 @@ if TYPE_CHECKING:
|
|
41
42
|
class DataformHook(GoogleBaseHook):
|
42
43
|
"""Hook for Google Cloud DataForm APIs."""
|
43
44
|
|
44
|
-
def __init__(self, **kwargs):
|
45
|
-
if kwargs.get("delegate_to") is not None:
|
46
|
-
raise RuntimeError(
|
47
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
48
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
49
|
-
)
|
50
|
-
super().__init__(**kwargs)
|
51
|
-
|
52
45
|
def get_dataform_client(self) -> DataformClient:
|
53
46
|
"""Retrieve client library object that allow access to Cloud Dataform service."""
|
54
47
|
return DataformClient(credentials=self.get_credentials())
|
@@ -22,7 +22,8 @@ import asyncio
|
|
22
22
|
import json
|
23
23
|
import os
|
24
24
|
import time
|
25
|
-
from
|
25
|
+
from collections.abc import Sequence
|
26
|
+
from typing import Any
|
26
27
|
from urllib.parse import quote, urlencode, urljoin
|
27
28
|
|
28
29
|
import google.auth
|
@@ -39,7 +40,7 @@ from airflow.providers.google.common.hooks.base_google import (
|
|
39
40
|
GoogleBaseHook,
|
40
41
|
)
|
41
42
|
|
42
|
-
Operation =
|
43
|
+
Operation = dict[str, Any]
|
43
44
|
|
44
45
|
|
45
46
|
class ConflictException(AirflowException):
|
@@ -78,14 +79,10 @@ class DataFusionHook(GoogleBaseHook):
|
|
78
79
|
impersonation_chain: str | Sequence[str] | None = None,
|
79
80
|
**kwargs,
|
80
81
|
) -> None:
|
81
|
-
if kwargs.get("delegate_to") is not None:
|
82
|
-
raise RuntimeError(
|
83
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
84
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
85
|
-
)
|
86
82
|
super().__init__(
|
87
83
|
gcp_conn_id=gcp_conn_id,
|
88
84
|
impersonation_chain=impersonation_chain,
|
85
|
+
**kwargs,
|
89
86
|
)
|
90
87
|
self.api_version = api_version
|
91
88
|
|
@@ -554,14 +551,6 @@ class DataFusionAsyncHook(GoogleBaseAsyncHook):
|
|
554
551
|
sync_hook_class = DataFusionHook
|
555
552
|
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
|
556
553
|
|
557
|
-
def __init__(self, **kwargs):
|
558
|
-
if kwargs.get("delegate_to") is not None:
|
559
|
-
raise RuntimeError(
|
560
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
561
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
562
|
-
)
|
563
|
-
super().__init__(**kwargs)
|
564
|
-
|
565
554
|
@staticmethod
|
566
555
|
def _base_url(instance_url: str, namespace: str) -> str:
|
567
556
|
return urljoin(f"{instance_url}/", f"v3/namespaces/{quote(namespace)}/apps/")
|
@@ -19,7 +19,8 @@
|
|
19
19
|
from __future__ import annotations
|
20
20
|
|
21
21
|
import time
|
22
|
-
from
|
22
|
+
from collections.abc import Sequence
|
23
|
+
from typing import TYPE_CHECKING, Any
|
23
24
|
|
24
25
|
from google.api_core.client_options import ClientOptions
|
25
26
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
@@ -85,14 +86,10 @@ class DataplexHook(GoogleBaseHook):
|
|
85
86
|
location: str | None = None,
|
86
87
|
**kwargs,
|
87
88
|
) -> None:
|
88
|
-
if kwargs.get("delegate_to") is not None:
|
89
|
-
raise RuntimeError(
|
90
|
-
"The `delegate_to` parameter has been deprecated before and finally removed in this version"
|
91
|
-
" of Google Provider. You MUST convert it to `impersonate_chain`"
|
92
|
-
)
|
93
89
|
super().__init__(
|
94
90
|
gcp_conn_id=gcp_conn_id,
|
95
91
|
impersonation_chain=impersonation_chain,
|
92
|
+
**kwargs,
|
96
93
|
)
|
97
94
|
self.api_version = api_version
|
98
95
|
self.location = location
|
@@ -883,7 +880,7 @@ class DataplexAsyncHook(GoogleBaseAsyncHook):
|
|
883
880
|
impersonation_chain: str | Sequence[str] | None = None,
|
884
881
|
**kwargs,
|
885
882
|
) -> None:
|
886
|
-
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
|
883
|
+
super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain, **kwargs)
|
887
884
|
|
888
885
|
async def get_dataplex_data_scan_client(self) -> DataScanServiceAsyncClient:
|
889
886
|
"""Return DataScanServiceAsyncClient."""
|
@@ -73,8 +73,8 @@ class GoogleDataprepHook(BaseHook):
|
|
73
73
|
conn_type = "dataprep"
|
74
74
|
hook_name = "Google Dataprep"
|
75
75
|
|
76
|
-
def __init__(self, dataprep_conn_id: str = default_conn_name, api_version: str = "v4") -> None:
|
77
|
-
super().__init__()
|
76
|
+
def __init__(self, dataprep_conn_id: str = default_conn_name, api_version: str = "v4", **kwargs) -> None:
|
77
|
+
super().__init__(**kwargs)
|
78
78
|
self.dataprep_conn_id = dataprep_conn_id
|
79
79
|
self.api_version = api_version
|
80
80
|
conn = self.get_connection(self.dataprep_conn_id)
|