apache-airflow-providers-google 9.0.0rc2__py3-none-any.whl → 10.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.
Files changed (122) hide show
  1. airflow/providers/google/cloud/hooks/automl.py +5 -6
  2. airflow/providers/google/cloud/hooks/bigquery.py +5 -6
  3. airflow/providers/google/cloud/hooks/bigquery_dts.py +11 -8
  4. airflow/providers/google/cloud/hooks/bigtable.py +5 -6
  5. airflow/providers/google/cloud/hooks/cloud_build.py +14 -11
  6. airflow/providers/google/cloud/hooks/cloud_composer.py +16 -0
  7. airflow/providers/google/cloud/hooks/cloud_memorystore.py +5 -14
  8. airflow/providers/google/cloud/hooks/cloud_sql.py +5 -7
  9. airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +5 -5
  10. airflow/providers/google/cloud/hooks/compute.py +5 -6
  11. airflow/providers/google/cloud/hooks/compute_ssh.py +8 -12
  12. airflow/providers/google/cloud/hooks/datacatalog.py +5 -9
  13. airflow/providers/google/cloud/hooks/dataflow.py +14 -6
  14. airflow/providers/google/cloud/hooks/dataform.py +8 -0
  15. airflow/providers/google/cloud/hooks/datafusion.py +13 -6
  16. airflow/providers/google/cloud/hooks/dataplex.py +5 -8
  17. airflow/providers/google/cloud/hooks/dataproc.py +13 -8
  18. airflow/providers/google/cloud/hooks/dataproc_metastore.py +8 -0
  19. airflow/providers/google/cloud/hooks/datastore.py +5 -6
  20. airflow/providers/google/cloud/hooks/dlp.py +5 -9
  21. airflow/providers/google/cloud/hooks/functions.py +5 -6
  22. airflow/providers/google/cloud/hooks/gcs.py +6 -6
  23. airflow/providers/google/cloud/hooks/gdm.py +5 -6
  24. airflow/providers/google/cloud/hooks/kms.py +5 -9
  25. airflow/providers/google/cloud/hooks/kubernetes_engine.py +6 -4
  26. airflow/providers/google/cloud/hooks/life_sciences.py +5 -9
  27. airflow/providers/google/cloud/hooks/mlengine.py +8 -0
  28. airflow/providers/google/cloud/hooks/natural_language.py +5 -9
  29. airflow/providers/google/cloud/hooks/os_login.py +5 -6
  30. airflow/providers/google/cloud/hooks/pubsub.py +5 -5
  31. airflow/providers/google/cloud/hooks/secret_manager.py +5 -9
  32. airflow/providers/google/cloud/hooks/spanner.py +5 -6
  33. airflow/providers/google/cloud/hooks/speech_to_text.py +5 -9
  34. airflow/providers/google/cloud/hooks/stackdriver.py +5 -6
  35. airflow/providers/google/cloud/hooks/tasks.py +5 -9
  36. airflow/providers/google/cloud/hooks/text_to_speech.py +5 -9
  37. airflow/providers/google/cloud/hooks/translate.py +5 -6
  38. airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +5 -5
  39. airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +5 -6
  40. airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +5 -6
  41. airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +8 -0
  42. airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +8 -0
  43. airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +5 -6
  44. airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +8 -0
  45. airflow/providers/google/cloud/hooks/video_intelligence.py +5 -9
  46. airflow/providers/google/cloud/hooks/vision.py +5 -6
  47. airflow/providers/google/cloud/hooks/workflows.py +8 -0
  48. airflow/providers/google/cloud/operators/bigquery.py +1 -148
  49. airflow/providers/google/cloud/operators/cloud_build.py +0 -13
  50. airflow/providers/google/cloud/operators/cloud_composer.py +2 -68
  51. airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +0 -21
  52. airflow/providers/google/cloud/operators/dataflow.py +2 -72
  53. airflow/providers/google/cloud/operators/dataform.py +5 -141
  54. airflow/providers/google/cloud/operators/datafusion.py +0 -102
  55. airflow/providers/google/cloud/operators/dataplex.py +3 -61
  56. airflow/providers/google/cloud/operators/dataproc.py +5 -13
  57. airflow/providers/google/cloud/operators/datastore.py +2 -86
  58. airflow/providers/google/cloud/operators/gcs.py +1 -43
  59. airflow/providers/google/cloud/operators/mlengine.py +1 -123
  60. airflow/providers/google/cloud/operators/pubsub.py +0 -61
  61. airflow/providers/google/cloud/operators/stackdriver.py +0 -101
  62. airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +0 -26
  63. airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +0 -41
  64. airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +0 -39
  65. airflow/providers/google/cloud/operators/vertex_ai/dataset.py +0 -71
  66. airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +0 -71
  67. airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +0 -35
  68. airflow/providers/google/cloud/operators/vertex_ai/model_service.py +0 -41
  69. airflow/providers/google/cloud/sensors/bigquery.py +0 -24
  70. airflow/providers/google/cloud/sensors/cloud_composer.py +0 -10
  71. airflow/providers/google/cloud/sensors/dataflow.py +0 -42
  72. airflow/providers/google/cloud/sensors/dataform.py +0 -12
  73. airflow/providers/google/cloud/sensors/datafusion.py +0 -11
  74. airflow/providers/google/cloud/sensors/dataplex.py +0 -10
  75. airflow/providers/google/cloud/sensors/gcs.py +0 -44
  76. airflow/providers/google/cloud/sensors/pubsub.py +0 -11
  77. airflow/providers/google/cloud/transfers/adls_to_gcs.py +0 -12
  78. airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +0 -12
  79. airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +0 -10
  80. airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +0 -11
  81. airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +0 -11
  82. airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +0 -11
  83. airflow/providers/google/cloud/transfers/calendar_to_gcs.py +0 -12
  84. airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +0 -11
  85. airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +0 -13
  86. airflow/providers/google/cloud/transfers/gcs_to_gcs.py +0 -11
  87. airflow/providers/google/cloud/transfers/gcs_to_local.py +0 -11
  88. airflow/providers/google/cloud/transfers/gcs_to_sftp.py +0 -11
  89. airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +0 -12
  90. airflow/providers/google/cloud/transfers/gdrive_to_local.py +0 -11
  91. airflow/providers/google/cloud/transfers/local_to_gcs.py +0 -9
  92. airflow/providers/google/cloud/transfers/s3_to_gcs.py +0 -11
  93. airflow/providers/google/cloud/transfers/sftp_to_gcs.py +0 -11
  94. airflow/providers/google/cloud/transfers/sheets_to_gcs.py +0 -12
  95. airflow/providers/google/cloud/transfers/sql_to_gcs.py +0 -11
  96. airflow/providers/google/cloud/triggers/bigquery_dts.py +0 -12
  97. airflow/providers/google/cloud/triggers/cloud_build.py +0 -11
  98. airflow/providers/google/cloud/triggers/cloud_composer.py +0 -9
  99. airflow/providers/google/cloud/triggers/dataflow.py +0 -7
  100. airflow/providers/google/cloud/triggers/datafusion.py +0 -11
  101. airflow/providers/google/cloud/triggers/dataproc.py +2 -8
  102. airflow/providers/google/cloud/triggers/kubernetes_engine.py +0 -4
  103. airflow/providers/google/cloud/triggers/mlengine.py +0 -3
  104. airflow/providers/google/common/hooks/discovery_api.py +0 -7
  105. airflow/providers/google/firebase/hooks/firestore.py +0 -10
  106. airflow/providers/google/get_provider_info.py +1 -0
  107. airflow/providers/google/marketing_platform/example_dags/example_display_video.py +0 -64
  108. airflow/providers/google/marketing_platform/hooks/campaign_manager.py +3 -3
  109. airflow/providers/google/marketing_platform/hooks/display_video.py +7 -38
  110. airflow/providers/google/marketing_platform/operators/campaign_manager.py +22 -22
  111. airflow/providers/google/marketing_platform/operators/display_video.py +0 -284
  112. airflow/providers/google/marketing_platform/sensors/campaign_manager.py +3 -3
  113. airflow/providers/google/marketing_platform/sensors/display_video.py +0 -65
  114. airflow/providers/google/suite/transfers/gcs_to_gdrive.py +0 -4
  115. airflow/providers/google/suite/transfers/gcs_to_sheets.py +0 -4
  116. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/METADATA +33 -4
  117. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/RECORD +122 -122
  118. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/LICENSE +0 -0
  119. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/NOTICE +0 -0
  120. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/WHEEL +0 -0
  121. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/entry_points.txt +0 -0
  122. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/top_level.txt +0 -0
@@ -20,7 +20,6 @@ from __future__ import annotations
20
20
 
21
21
  import time
22
22
  import uuid
23
- import warnings
24
23
  from typing import Any, Sequence
25
24
 
26
25
  from google.api_core.client_options import ClientOptions
@@ -209,14 +208,15 @@ class DataprocHook(GoogleBaseHook):
209
208
  def __init__(
210
209
  self,
211
210
  gcp_conn_id: str = "google_cloud_default",
212
- delegate_to: str | None = None,
213
211
  impersonation_chain: str | Sequence[str] | None = None,
212
+ **kwargs,
214
213
  ) -> None:
215
- if delegate_to:
216
- warnings.warn(
217
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
214
+ if kwargs.get("delegate_to") is not None:
215
+ raise RuntimeError(
216
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
217
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
218
218
  )
219
- super().__init__(gcp_conn_id, delegate_to, impersonation_chain)
219
+ super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
220
220
 
221
221
  def get_cluster_client(self, region: str | None = None) -> ClusterControllerClient:
222
222
  """Returns ClusterControllerClient."""
@@ -1060,10 +1060,15 @@ class DataprocAsyncHook(GoogleBaseHook):
1060
1060
  def __init__(
1061
1061
  self,
1062
1062
  gcp_conn_id: str = "google_cloud_default",
1063
- delegate_to: str | None = None,
1064
1063
  impersonation_chain: str | Sequence[str] | None = None,
1064
+ **kwargs,
1065
1065
  ) -> None:
1066
- super().__init__(gcp_conn_id, delegate_to, impersonation_chain)
1066
+ if kwargs.get("delegate_to") is not None:
1067
+ raise RuntimeError(
1068
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
1069
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
1070
+ )
1071
+ super().__init__(gcp_conn_id=gcp_conn_id, impersonation_chain=impersonation_chain)
1067
1072
  self._cached_client: JobControllerAsyncClient | None = None
1068
1073
 
1069
1074
  def get_cluster_client(self, region: str | None = None) -> ClusterControllerAsyncClient:
@@ -37,6 +37,14 @@ from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
37
37
  class DataprocMetastoreHook(GoogleBaseHook):
38
38
  """Hook for Google Cloud Dataproc Metastore APIs."""
39
39
 
40
+ def __init__(self, **kwargs):
41
+ if kwargs.get("delegate_to") is not None:
42
+ raise RuntimeError(
43
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
44
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
45
+ )
46
+ super().__init__(**kwargs)
47
+
40
48
  def get_dataproc_metastore_client(self) -> DataprocMetastoreClient:
41
49
  """Returns DataprocMetastoreClient."""
42
50
  client_options = ClientOptions(api_endpoint="metastore.googleapis.com:443")
@@ -19,7 +19,6 @@
19
19
  from __future__ import annotations
20
20
 
21
21
  import time
22
- import warnings
23
22
  from typing import Any, Sequence
24
23
 
25
24
  from googleapiclient.discovery import Resource, build
@@ -40,17 +39,17 @@ class DatastoreHook(GoogleBaseHook):
40
39
  def __init__(
41
40
  self,
42
41
  gcp_conn_id: str = "google_cloud_default",
43
- delegate_to: str | None = None,
44
42
  api_version: str = "v1",
45
43
  impersonation_chain: str | Sequence[str] | None = None,
44
+ **kwargs,
46
45
  ) -> None:
47
- if delegate_to:
48
- warnings.warn(
49
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
46
+ if kwargs.get("delegate_to") is not None:
47
+ raise RuntimeError(
48
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
49
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
50
50
  )
51
51
  super().__init__(
52
52
  gcp_conn_id=gcp_conn_id,
53
- delegate_to=delegate_to,
54
53
  impersonation_chain=impersonation_chain,
55
54
  )
56
55
  self.connection = None
@@ -28,7 +28,6 @@ from __future__ import annotations
28
28
 
29
29
  import re
30
30
  import time
31
- import warnings
32
31
  from typing import Sequence
33
32
 
34
33
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -73,9 +72,6 @@ class CloudDLPHook(GoogleBaseHook):
73
72
  on Google Cloud based data sets.
74
73
 
75
74
  :param gcp_conn_id: The connection ID to use when fetching connection info.
76
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
77
- if any. For this to work, the service account making the request must have
78
- domain-wide delegation enabled.
79
75
  :param impersonation_chain: Optional service account to impersonate using short-term
80
76
  credentials, or chained list of accounts required to get the access_token
81
77
  of the last account in the list, which will be impersonated in the request.
@@ -89,16 +85,16 @@ class CloudDLPHook(GoogleBaseHook):
89
85
  def __init__(
90
86
  self,
91
87
  gcp_conn_id: str = "google_cloud_default",
92
- delegate_to: str | None = None,
93
88
  impersonation_chain: str | Sequence[str] | None = None,
89
+ **kwargs,
94
90
  ) -> None:
95
- if delegate_to:
96
- warnings.warn(
97
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
91
+ if kwargs.get("delegate_to") is not None:
92
+ raise RuntimeError(
93
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
94
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
98
95
  )
99
96
  super().__init__(
100
97
  gcp_conn_id=gcp_conn_id,
101
- delegate_to=delegate_to,
102
98
  impersonation_chain=impersonation_chain,
103
99
  )
104
100
  self._client: DlpServiceClient | None = None
@@ -19,7 +19,6 @@
19
19
  from __future__ import annotations
20
20
 
21
21
  import time
22
- import warnings
23
22
  from typing import Sequence
24
23
 
25
24
  import requests
@@ -46,16 +45,16 @@ class CloudFunctionsHook(GoogleBaseHook):
46
45
  self,
47
46
  api_version: str,
48
47
  gcp_conn_id: str = "google_cloud_default",
49
- delegate_to: str | None = None,
50
48
  impersonation_chain: str | Sequence[str] | None = None,
49
+ **kwargs,
51
50
  ) -> None:
52
- if delegate_to:
53
- warnings.warn(
54
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
51
+ if kwargs.get("delegate_to") is not None:
52
+ raise RuntimeError(
53
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
54
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
55
55
  )
56
56
  super().__init__(
57
57
  gcp_conn_id=gcp_conn_id,
58
- delegate_to=delegate_to,
59
58
  impersonation_chain=impersonation_chain,
60
59
  )
61
60
  self.api_version = api_version
@@ -23,7 +23,6 @@ import gzip as gz
23
23
  import os
24
24
  import shutil
25
25
  import time
26
- import warnings
27
26
  from contextlib import contextmanager
28
27
  from datetime import datetime
29
28
  from functools import partial
@@ -152,16 +151,17 @@ class GCSHook(GoogleBaseHook):
152
151
  def __init__(
153
152
  self,
154
153
  gcp_conn_id: str = "google_cloud_default",
155
- delegate_to: str | None = None,
156
154
  impersonation_chain: str | Sequence[str] | None = None,
155
+ **kwargs,
157
156
  ) -> None:
158
- if delegate_to:
159
- warnings.warn(
160
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
157
+ if kwargs.get("delegate_to") is not None:
158
+ raise RuntimeError(
159
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
160
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
161
161
  )
162
+
162
163
  super().__init__(
163
164
  gcp_conn_id=gcp_conn_id,
164
- delegate_to=delegate_to,
165
165
  impersonation_chain=impersonation_chain,
166
166
  )
167
167
 
@@ -17,7 +17,6 @@
17
17
  # under the License.
18
18
  from __future__ import annotations
19
19
 
20
- import warnings
21
20
  from typing import Any, Sequence
22
21
 
23
22
  from googleapiclient.discovery import Resource, build
@@ -35,16 +34,16 @@ class GoogleDeploymentManagerHook(GoogleBaseHook):
35
34
  def __init__(
36
35
  self,
37
36
  gcp_conn_id: str = "google_cloud_default",
38
- delegate_to: str | None = None,
39
37
  impersonation_chain: str | Sequence[str] | None = None,
38
+ **kwargs,
40
39
  ) -> None:
41
- if delegate_to:
42
- warnings.warn(
43
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
40
+ if kwargs.get("delegate_to") is not None:
41
+ raise RuntimeError(
42
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
43
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
44
44
  )
45
45
  super().__init__(
46
46
  gcp_conn_id=gcp_conn_id,
47
- delegate_to=delegate_to,
48
47
  impersonation_chain=impersonation_chain,
49
48
  )
50
49
 
@@ -19,7 +19,6 @@
19
19
  from __future__ import annotations
20
20
 
21
21
  import base64
22
- import warnings
23
22
  from typing import Sequence
24
23
 
25
24
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -45,9 +44,6 @@ class CloudKMSHook(GoogleBaseHook):
45
44
  Hook for Google Cloud Key Management service.
46
45
 
47
46
  :param gcp_conn_id: The connection ID to use when fetching connection info.
48
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
49
- if any. For this to work, the service account making the request must have
50
- domain-wide delegation enabled.
51
47
  :param impersonation_chain: Optional service account to impersonate using short-term
52
48
  credentials, or chained list of accounts required to get the access_token
53
49
  of the last account in the list, which will be impersonated in the request.
@@ -61,16 +57,16 @@ class CloudKMSHook(GoogleBaseHook):
61
57
  def __init__(
62
58
  self,
63
59
  gcp_conn_id: str = "google_cloud_default",
64
- delegate_to: str | None = None,
65
60
  impersonation_chain: str | Sequence[str] | None = None,
61
+ **kwargs,
66
62
  ) -> None:
67
- if delegate_to:
68
- warnings.warn(
69
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
63
+ if kwargs.get("delegate_to") is not None:
64
+ raise RuntimeError(
65
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
66
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
70
67
  )
71
68
  super().__init__(
72
69
  gcp_conn_id=gcp_conn_id,
73
- delegate_to=delegate_to,
74
70
  impersonation_chain=impersonation_chain,
75
71
  )
76
72
  self._conn: KeyManagementServiceClient | None = None
@@ -73,13 +73,17 @@ class GKEHook(GoogleBaseHook):
73
73
  def __init__(
74
74
  self,
75
75
  gcp_conn_id: str = "google_cloud_default",
76
- delegate_to: str | None = None,
77
76
  location: str | None = None,
78
77
  impersonation_chain: str | Sequence[str] | None = None,
78
+ **kwargs,
79
79
  ) -> None:
80
+ if kwargs.get("delegate_to") is not None:
81
+ raise RuntimeError(
82
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
83
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
84
+ )
80
85
  super().__init__(
81
86
  gcp_conn_id=gcp_conn_id,
82
- delegate_to=delegate_to,
83
87
  impersonation_chain=impersonation_chain,
84
88
  )
85
89
  self._client: ClusterManagerClient | None = None
@@ -303,13 +307,11 @@ class GKEAsyncHook(GoogleBaseAsyncHook):
303
307
  def __init__(
304
308
  self,
305
309
  gcp_conn_id: str = "google_cloud_default",
306
- delegate_to: str | None = None,
307
310
  location: str | None = None,
308
311
  impersonation_chain: str | Sequence[str] | None = None,
309
312
  ) -> None:
310
313
  super().__init__(
311
314
  gcp_conn_id=gcp_conn_id,
312
- delegate_to=delegate_to,
313
315
  impersonation_chain=impersonation_chain,
314
316
  )
315
317
  self._client: ClusterManagerAsyncClient | None = None
@@ -19,7 +19,6 @@
19
19
  from __future__ import annotations
20
20
 
21
21
  import time
22
- import warnings
23
22
  from typing import Sequence
24
23
 
25
24
  import google.api_core.path_template
@@ -41,9 +40,6 @@ class LifeSciencesHook(GoogleBaseHook):
41
40
 
42
41
  :param api_version: API version used (for example v1 or v1beta1).
43
42
  :param gcp_conn_id: The connection ID to use when fetching connection info.
44
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
45
- if any. For this to work, the service account making the request must have
46
- domain-wide delegation enabled.
47
43
  :param impersonation_chain: Optional service account to impersonate using short-term
48
44
  credentials, or chained list of accounts required to get the access_token
49
45
  of the last account in the list, which will be impersonated in the request.
@@ -60,16 +56,16 @@ class LifeSciencesHook(GoogleBaseHook):
60
56
  self,
61
57
  api_version: str = "v2beta",
62
58
  gcp_conn_id: str = "google_cloud_default",
63
- delegate_to: str | None = None,
64
59
  impersonation_chain: str | Sequence[str] | None = None,
60
+ **kwargs,
65
61
  ) -> None:
66
- if delegate_to:
67
- warnings.warn(
68
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
62
+ if kwargs.get("delegate_to") is not None:
63
+ raise RuntimeError(
64
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
65
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
69
66
  )
70
67
  super().__init__(
71
68
  gcp_conn_id=gcp_conn_id,
72
- delegate_to=delegate_to,
73
69
  impersonation_chain=impersonation_chain,
74
70
  )
75
71
  self.api_version = api_version
@@ -84,6 +84,14 @@ class MLEngineHook(GoogleBaseHook):
84
84
  keyword arguments rather than positional.
85
85
  """
86
86
 
87
+ def __init__(self, **kwargs):
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
+ super().__init__(**kwargs)
94
+
87
95
  def get_conn(self) -> Resource:
88
96
  """
89
97
  Retrieves the connection to MLEngine.
@@ -18,7 +18,6 @@
18
18
  """This module contains a Google Cloud Natural Language Hook."""
19
19
  from __future__ import annotations
20
20
 
21
- import warnings
22
21
  from typing import Sequence
23
22
 
24
23
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -44,9 +43,6 @@ class CloudNaturalLanguageHook(GoogleBaseHook):
44
43
  Hook for Google Cloud Natural Language Service.
45
44
 
46
45
  :param gcp_conn_id: The connection ID to use when fetching connection info.
47
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
48
- if any. For this to work, the service account making the request must have
49
- domain-wide delegation enabled.
50
46
  :param impersonation_chain: Optional service account to impersonate using short-term
51
47
  credentials, or chained list of accounts required to get the access_token
52
48
  of the last account in the list, which will be impersonated in the request.
@@ -60,16 +56,16 @@ class CloudNaturalLanguageHook(GoogleBaseHook):
60
56
  def __init__(
61
57
  self,
62
58
  gcp_conn_id: str = "google_cloud_default",
63
- delegate_to: str | None = None,
64
59
  impersonation_chain: str | Sequence[str] | None = None,
60
+ **kwargs,
65
61
  ) -> None:
66
- if delegate_to:
67
- warnings.warn(
68
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
62
+ if kwargs.get("delegate_to") is not None:
63
+ raise RuntimeError(
64
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
65
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
69
66
  )
70
67
  super().__init__(
71
68
  gcp_conn_id=gcp_conn_id,
72
- delegate_to=delegate_to,
73
69
  impersonation_chain=impersonation_chain,
74
70
  )
75
71
  self._conn = None
@@ -22,7 +22,6 @@
22
22
  """
23
23
  from __future__ import annotations
24
24
 
25
- import warnings
26
25
  from typing import Sequence
27
26
 
28
27
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -44,16 +43,16 @@ class OSLoginHook(GoogleBaseHook):
44
43
  def __init__(
45
44
  self,
46
45
  gcp_conn_id: str = "google_cloud_default",
47
- delegate_to: str | None = None,
48
46
  impersonation_chain: str | Sequence[str] | None = None,
47
+ **kwargs,
49
48
  ) -> None:
50
- if delegate_to:
51
- warnings.warn(
52
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
49
+ if kwargs.get("delegate_to") is not None:
50
+ raise RuntimeError(
51
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
52
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
53
53
  )
54
54
  super().__init__(
55
55
  gcp_conn_id=gcp_conn_id,
56
- delegate_to=delegate_to,
57
56
  impersonation_chain=impersonation_chain,
58
57
  )
59
58
  self._conn: OsLoginServiceClient | None = None
@@ -67,16 +67,16 @@ class PubSubHook(GoogleBaseHook):
67
67
  def __init__(
68
68
  self,
69
69
  gcp_conn_id: str = "google_cloud_default",
70
- delegate_to: str | None = None,
71
70
  impersonation_chain: str | Sequence[str] | None = None,
71
+ **kwargs,
72
72
  ) -> None:
73
- if delegate_to:
74
- warnings.warn(
75
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
73
+ if kwargs.get("delegate_to") is not None:
74
+ raise RuntimeError(
75
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
76
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
76
77
  )
77
78
  super().__init__(
78
79
  gcp_conn_id=gcp_conn_id,
79
- delegate_to=delegate_to,
80
80
  impersonation_chain=impersonation_chain,
81
81
  )
82
82
  self._client = None
@@ -18,7 +18,6 @@
18
18
  """Hook for Secrets Manager service"""
19
19
  from __future__ import annotations
20
20
 
21
- import warnings
22
21
  from typing import Sequence
23
22
 
24
23
  from airflow.providers.google.cloud._internal_client.secret_manager_client import _SecretManagerClient
@@ -35,9 +34,6 @@ class SecretsManagerHook(GoogleBaseHook):
35
34
  keyword arguments rather than positional.
36
35
 
37
36
  :param gcp_conn_id: The connection ID to use when fetching connection info.
38
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
39
- if any. For this to work, the service account making the request must have
40
- domain-wide delegation enabled. (Deprecated)
41
37
  :param impersonation_chain: Optional service account to impersonate using short-term
42
38
  credentials, or chained list of accounts required to get the access_token
43
39
  of the last account in the list, which will be impersonated in the request.
@@ -51,16 +47,16 @@ class SecretsManagerHook(GoogleBaseHook):
51
47
  def __init__(
52
48
  self,
53
49
  gcp_conn_id: str = "google_cloud_default",
54
- delegate_to: str | None = None,
55
50
  impersonation_chain: str | Sequence[str] | None = None,
51
+ **kwargs,
56
52
  ) -> None:
57
- if delegate_to:
58
- warnings.warn(
59
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
53
+ if kwargs.get("delegate_to") is not None:
54
+ raise RuntimeError(
55
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
56
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
60
57
  )
61
58
  super().__init__(
62
59
  gcp_conn_id=gcp_conn_id,
63
- delegate_to=delegate_to,
64
60
  impersonation_chain=impersonation_chain,
65
61
  )
66
62
  self.client = _SecretManagerClient(credentials=self.get_credentials())
@@ -18,7 +18,6 @@
18
18
  """This module contains a Google Cloud Spanner Hook."""
19
19
  from __future__ import annotations
20
20
 
21
- import warnings
22
21
  from typing import Callable, Sequence
23
22
 
24
23
  from google.api_core.exceptions import AlreadyExists, GoogleAPICallError
@@ -44,16 +43,16 @@ class SpannerHook(GoogleBaseHook):
44
43
  def __init__(
45
44
  self,
46
45
  gcp_conn_id: str = "google_cloud_default",
47
- delegate_to: str | None = None,
48
46
  impersonation_chain: str | Sequence[str] | None = None,
47
+ **kwargs,
49
48
  ) -> None:
50
- if delegate_to:
51
- warnings.warn(
52
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
49
+ if kwargs.get("delegate_to") is not None:
50
+ raise RuntimeError(
51
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
52
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
53
53
  )
54
54
  super().__init__(
55
55
  gcp_conn_id=gcp_conn_id,
56
- delegate_to=delegate_to,
57
56
  impersonation_chain=impersonation_chain,
58
57
  )
59
58
  self._client = None
@@ -18,7 +18,6 @@
18
18
  """This module contains a Google Cloud Speech Hook."""
19
19
  from __future__ import annotations
20
20
 
21
- import warnings
22
21
  from typing import Sequence
23
22
 
24
23
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -35,9 +34,6 @@ class CloudSpeechToTextHook(GoogleBaseHook):
35
34
  Hook for Google Cloud Speech API.
36
35
 
37
36
  :param gcp_conn_id: The connection ID to use when fetching connection info.
38
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
39
- if any. For this to work, the service account making the request must have
40
- domain-wide delegation enabled.
41
37
  :param impersonation_chain: Optional service account to impersonate using short-term
42
38
  credentials, or chained list of accounts required to get the access_token
43
39
  of the last account in the list, which will be impersonated in the request.
@@ -51,16 +47,16 @@ class CloudSpeechToTextHook(GoogleBaseHook):
51
47
  def __init__(
52
48
  self,
53
49
  gcp_conn_id: str = "google_cloud_default",
54
- delegate_to: str | None = None,
55
50
  impersonation_chain: str | Sequence[str] | None = None,
51
+ **kwargs,
56
52
  ) -> None:
57
- if delegate_to:
58
- warnings.warn(
59
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
53
+ if kwargs.get("delegate_to") is not None:
54
+ raise RuntimeError(
55
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
56
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
60
57
  )
61
58
  super().__init__(
62
59
  gcp_conn_id=gcp_conn_id,
63
- delegate_to=delegate_to,
64
60
  impersonation_chain=impersonation_chain,
65
61
  )
66
62
  self._client = None
@@ -19,7 +19,6 @@
19
19
  from __future__ import annotations
20
20
 
21
21
  import json
22
- import warnings
23
22
  from typing import Any, Sequence
24
23
 
25
24
  from google.api_core.exceptions import InvalidArgument
@@ -40,16 +39,16 @@ class StackdriverHook(GoogleBaseHook):
40
39
  def __init__(
41
40
  self,
42
41
  gcp_conn_id: str = "google_cloud_default",
43
- delegate_to: str | None = None,
44
42
  impersonation_chain: str | Sequence[str] | None = None,
43
+ **kwargs,
45
44
  ) -> None:
46
- if delegate_to:
47
- warnings.warn(
48
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
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
49
  )
50
50
  super().__init__(
51
51
  gcp_conn_id=gcp_conn_id,
52
- delegate_to=delegate_to,
53
52
  impersonation_chain=impersonation_chain,
54
53
  )
55
54
  self._policy_client = None
@@ -22,7 +22,6 @@ performing actions to queues or tasks.
22
22
  """
23
23
  from __future__ import annotations
24
24
 
25
- import warnings
26
25
  from typing import Sequence
27
26
 
28
27
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
@@ -45,9 +44,6 @@ class CloudTasksHook(GoogleBaseHook):
45
44
  keyword arguments rather than positional.
46
45
 
47
46
  :param gcp_conn_id: The connection ID to use when fetching connection info.
48
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
49
- if any. For this to work, the service account making the request must have
50
- domain-wide delegation enabled.
51
47
  :param impersonation_chain: Optional service account to impersonate using short-term
52
48
  credentials, or chained list of accounts required to get the access_token
53
49
  of the last account in the list, which will be impersonated in the request.
@@ -61,16 +57,16 @@ class CloudTasksHook(GoogleBaseHook):
61
57
  def __init__(
62
58
  self,
63
59
  gcp_conn_id: str = "google_cloud_default",
64
- delegate_to: str | None = None,
65
60
  impersonation_chain: str | Sequence[str] | None = None,
61
+ **kwargs,
66
62
  ) -> None:
67
- if delegate_to:
68
- warnings.warn(
69
- "'delegate_to' parameter is deprecated, please use 'impersonation_chain'", DeprecationWarning
63
+ if kwargs.get("delegate_to") is not None:
64
+ raise RuntimeError(
65
+ "The `delegate_to` parameter has been deprecated before and finally removed in this version"
66
+ " of Google Provider. You MUST convert it to `impersonate_chain`"
70
67
  )
71
68
  super().__init__(
72
69
  gcp_conn_id=gcp_conn_id,
73
- delegate_to=delegate_to,
74
70
  impersonation_chain=impersonation_chain,
75
71
  )
76
72
  self._client: CloudTasksClient | None = None