apache-airflow-providers-google 10.14.0rc1__py3-none-any.whl → 10.15.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 +1 -2
- airflow/providers/google/cloud/hooks/automl.py +13 -13
- airflow/providers/google/cloud/hooks/bigquery.py +208 -256
- airflow/providers/google/cloud/hooks/bigquery_dts.py +6 -6
- airflow/providers/google/cloud/hooks/bigtable.py +8 -8
- airflow/providers/google/cloud/hooks/cloud_batch.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_build.py +19 -20
- airflow/providers/google/cloud/hooks/cloud_composer.py +4 -4
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +10 -10
- airflow/providers/google/cloud/hooks/cloud_run.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_sql.py +18 -19
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +3 -3
- airflow/providers/google/cloud/hooks/compute.py +16 -16
- airflow/providers/google/cloud/hooks/compute_ssh.py +1 -1
- airflow/providers/google/cloud/hooks/datacatalog.py +22 -22
- airflow/providers/google/cloud/hooks/dataflow.py +48 -49
- airflow/providers/google/cloud/hooks/dataform.py +16 -16
- airflow/providers/google/cloud/hooks/datafusion.py +15 -15
- airflow/providers/google/cloud/hooks/datapipeline.py +3 -3
- airflow/providers/google/cloud/hooks/dataplex.py +19 -19
- airflow/providers/google/cloud/hooks/dataprep.py +10 -10
- airflow/providers/google/cloud/hooks/dataproc.py +132 -14
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +13 -13
- airflow/providers/google/cloud/hooks/datastore.py +3 -3
- airflow/providers/google/cloud/hooks/dlp.py +25 -25
- airflow/providers/google/cloud/hooks/gcs.py +39 -27
- airflow/providers/google/cloud/hooks/gdm.py +3 -3
- airflow/providers/google/cloud/hooks/kms.py +3 -3
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +63 -48
- airflow/providers/google/cloud/hooks/life_sciences.py +13 -12
- airflow/providers/google/cloud/hooks/looker.py +8 -9
- airflow/providers/google/cloud/hooks/mlengine.py +12 -12
- airflow/providers/google/cloud/hooks/natural_language.py +2 -2
- airflow/providers/google/cloud/hooks/os_login.py +1 -1
- airflow/providers/google/cloud/hooks/pubsub.py +9 -9
- airflow/providers/google/cloud/hooks/secret_manager.py +1 -1
- airflow/providers/google/cloud/hooks/spanner.py +11 -11
- airflow/providers/google/cloud/hooks/speech_to_text.py +1 -1
- airflow/providers/google/cloud/hooks/stackdriver.py +7 -7
- airflow/providers/google/cloud/hooks/tasks.py +11 -11
- airflow/providers/google/cloud/hooks/text_to_speech.py +1 -1
- airflow/providers/google/cloud/hooks/translate.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +13 -13
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +6 -6
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +45 -50
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +13 -13
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +9 -9
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +128 -11
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +10 -10
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +8 -8
- airflow/providers/google/cloud/hooks/video_intelligence.py +2 -2
- airflow/providers/google/cloud/hooks/vision.py +1 -1
- airflow/providers/google/cloud/hooks/workflows.py +10 -10
- airflow/providers/google/cloud/links/datafusion.py +12 -5
- airflow/providers/google/cloud/operators/bigquery.py +11 -11
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +3 -1
- airflow/providers/google/cloud/operators/dataflow.py +16 -16
- airflow/providers/google/cloud/operators/datafusion.py +9 -1
- airflow/providers/google/cloud/operators/dataproc.py +444 -69
- airflow/providers/google/cloud/operators/kubernetes_engine.py +6 -6
- airflow/providers/google/cloud/operators/life_sciences.py +10 -9
- airflow/providers/google/cloud/operators/mlengine.py +96 -96
- airflow/providers/google/cloud/operators/pubsub.py +2 -0
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +33 -3
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +59 -2
- airflow/providers/google/cloud/secrets/secret_manager.py +8 -7
- airflow/providers/google/cloud/sensors/bigquery.py +20 -16
- airflow/providers/google/cloud/sensors/cloud_composer.py +11 -8
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +12 -2
- airflow/providers/google/cloud/sensors/gcs.py +8 -7
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +1 -0
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +4 -4
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +1 -0
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +1 -1
- airflow/providers/google/cloud/transfers/mssql_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/mysql_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/oracle_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/postgres_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/presto_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +3 -3
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +3 -3
- airflow/providers/google/cloud/transfers/trino_to_gcs.py +1 -1
- airflow/providers/google/cloud/triggers/bigquery.py +12 -12
- airflow/providers/google/cloud/triggers/bigquery_dts.py +1 -1
- airflow/providers/google/cloud/triggers/cloud_batch.py +3 -1
- airflow/providers/google/cloud/triggers/cloud_build.py +2 -2
- airflow/providers/google/cloud/triggers/cloud_run.py +1 -1
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +6 -6
- airflow/providers/google/cloud/triggers/dataflow.py +3 -1
- airflow/providers/google/cloud/triggers/datafusion.py +2 -2
- airflow/providers/google/cloud/triggers/dataplex.py +2 -2
- airflow/providers/google/cloud/triggers/dataproc.py +34 -14
- airflow/providers/google/cloud/triggers/gcs.py +12 -8
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +2 -2
- airflow/providers/google/cloud/triggers/mlengine.py +2 -2
- airflow/providers/google/cloud/triggers/pubsub.py +1 -1
- airflow/providers/google/cloud/triggers/vertex_ai.py +99 -0
- airflow/providers/google/cloud/utils/bigquery.py +2 -2
- airflow/providers/google/cloud/utils/credentials_provider.py +2 -2
- airflow/providers/google/cloud/utils/dataform.py +1 -1
- airflow/providers/google/cloud/utils/dataproc.py +25 -0
- airflow/providers/google/cloud/utils/field_validator.py +2 -2
- airflow/providers/google/cloud/utils/helpers.py +2 -2
- airflow/providers/google/cloud/utils/mlengine_operator_utils.py +1 -1
- airflow/providers/google/cloud/utils/mlengine_prediction_summary.py +1 -1
- airflow/providers/google/common/auth_backend/google_openid.py +2 -2
- airflow/providers/google/common/hooks/base_google.py +87 -23
- airflow/providers/google/common/hooks/discovery_api.py +2 -2
- airflow/providers/google/common/utils/id_token_credentials.py +5 -5
- airflow/providers/google/firebase/hooks/firestore.py +3 -3
- airflow/providers/google/get_provider_info.py +7 -2
- airflow/providers/google/leveldb/hooks/leveldb.py +4 -4
- airflow/providers/google/marketing_platform/hooks/analytics.py +11 -14
- airflow/providers/google/marketing_platform/hooks/campaign_manager.py +11 -11
- airflow/providers/google/marketing_platform/hooks/display_video.py +13 -13
- airflow/providers/google/marketing_platform/hooks/search_ads.py +4 -4
- airflow/providers/google/marketing_platform/operators/analytics.py +37 -32
- airflow/providers/google/suite/hooks/calendar.py +2 -2
- airflow/providers/google/suite/hooks/drive.py +7 -7
- airflow/providers/google/suite/hooks/sheets.py +8 -8
- {apache_airflow_providers_google-10.14.0rc1.dist-info → apache_airflow_providers_google-10.15.0rc1.dist-info}/METADATA +11 -11
- {apache_airflow_providers_google-10.14.0rc1.dist-info → apache_airflow_providers_google-10.15.0rc1.dist-info}/RECORD +126 -124
- {apache_airflow_providers_google-10.14.0rc1.dist-info → apache_airflow_providers_google-10.15.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-10.14.0rc1.dist-info → apache_airflow_providers_google-10.15.0rc1.dist-info}/entry_points.txt +0 -0
@@ -97,7 +97,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
97
97
|
|
98
98
|
def get_conn(self) -> Resource:
|
99
99
|
"""
|
100
|
-
|
100
|
+
Retrieve the connection to MLEngine.
|
101
101
|
|
102
102
|
:return: Google MLEngine services object.
|
103
103
|
"""
|
@@ -107,7 +107,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
107
107
|
@GoogleBaseHook.fallback_to_default_project_id
|
108
108
|
def create_job(self, job: dict, project_id: str, use_existing_job_fn: Callable | None = None) -> dict:
|
109
109
|
"""
|
110
|
-
|
110
|
+
Launch a MLEngine job and wait for it to reach a terminal state.
|
111
111
|
|
112
112
|
:param project_id: The Google Cloud project id within which MLEngine
|
113
113
|
job will be launched. If set to None or missing, the default project_id from the Google Cloud
|
@@ -169,7 +169,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
169
169
|
project_id: str,
|
170
170
|
):
|
171
171
|
"""
|
172
|
-
|
172
|
+
Launch a MLEngine job and wait for it to reach a terminal state.
|
173
173
|
|
174
174
|
:param project_id: The Google Cloud project id within which MLEngine
|
175
175
|
job will be launched. If set to None or missing, the default project_id from the Google Cloud
|
@@ -202,7 +202,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
202
202
|
project_id: str,
|
203
203
|
) -> dict:
|
204
204
|
"""
|
205
|
-
|
205
|
+
Cancel a MLEngine job.
|
206
206
|
|
207
207
|
:param project_id: The Google Cloud project id within which MLEngine
|
208
208
|
job will be cancelled. If set to None or missing, the default project_id from the Google Cloud
|
@@ -231,7 +231,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
231
231
|
|
232
232
|
def get_job(self, project_id: str, job_id: str) -> dict:
|
233
233
|
"""
|
234
|
-
|
234
|
+
Get a MLEngine job based on the job id.
|
235
235
|
|
236
236
|
:param project_id: The project in which the Job is located. If set to None or missing, the default
|
237
237
|
project_id from the Google Cloud connection is used. (templated)
|
@@ -255,7 +255,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
255
255
|
|
256
256
|
def _wait_for_job_done(self, project_id: str, job_id: str, interval: int = 30):
|
257
257
|
"""
|
258
|
-
|
258
|
+
Wait for the Job to reach a terminal state.
|
259
259
|
|
260
260
|
This method will periodically check the job state until the job reach
|
261
261
|
a terminal state.
|
@@ -284,7 +284,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
284
284
|
project_id: str,
|
285
285
|
) -> dict:
|
286
286
|
"""
|
287
|
-
|
287
|
+
Create the Version on Google Cloud ML Engine.
|
288
288
|
|
289
289
|
:param version_spec: A dictionary containing the information about the version. (templated)
|
290
290
|
:param model_name: The name of the Google Cloud ML Engine model that the version belongs to.
|
@@ -320,7 +320,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
320
320
|
project_id: str,
|
321
321
|
) -> dict:
|
322
322
|
"""
|
323
|
-
|
323
|
+
Set a version to be the default. Blocks until finished.
|
324
324
|
|
325
325
|
:param model_name: The name of the Google Cloud ML Engine model that the version belongs to.
|
326
326
|
(templated)
|
@@ -351,7 +351,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
351
351
|
project_id: str,
|
352
352
|
) -> list[dict]:
|
353
353
|
"""
|
354
|
-
|
354
|
+
List all available versions of a model. Blocks until finished.
|
355
355
|
|
356
356
|
:param model_name: The name of the Google Cloud ML Engine model that the version
|
357
357
|
belongs to. (templated)
|
@@ -387,7 +387,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
387
387
|
project_id: str,
|
388
388
|
) -> dict:
|
389
389
|
"""
|
390
|
-
|
390
|
+
Delete the given version of a model. Blocks until finished.
|
391
391
|
|
392
392
|
:param model_name: The name of the Google Cloud ML Engine model that the version
|
393
393
|
belongs to. (templated)
|
@@ -467,7 +467,7 @@ class MLEngineHook(GoogleBaseHook):
|
|
467
467
|
project_id: str,
|
468
468
|
) -> dict | None:
|
469
469
|
"""
|
470
|
-
|
470
|
+
Get a Model. Blocks until finished.
|
471
471
|
|
472
472
|
:param model_name: The name of the model.
|
473
473
|
:param project_id: The Google Cloud project name to which MLEngine model belongs. If set to None
|
@@ -581,7 +581,7 @@ class MLEngineAsyncHook(GoogleBaseAsyncHook):
|
|
581
581
|
project_id: str | None = None,
|
582
582
|
) -> str | None:
|
583
583
|
"""
|
584
|
-
|
584
|
+
Poll for job status asynchronously using gcloud-aio.
|
585
585
|
|
586
586
|
Note that an OSError is raised when Job results are still pending.
|
587
587
|
Exception means that Job finished with errors
|
@@ -74,7 +74,7 @@ class CloudNaturalLanguageHook(GoogleBaseHook):
|
|
74
74
|
|
75
75
|
def get_conn(self) -> LanguageServiceClient:
|
76
76
|
"""
|
77
|
-
|
77
|
+
Retrieve connection to Cloud Natural Language service.
|
78
78
|
|
79
79
|
:return: Cloud Natural Language service object
|
80
80
|
"""
|
@@ -92,7 +92,7 @@ class CloudNaturalLanguageHook(GoogleBaseHook):
|
|
92
92
|
metadata: Sequence[tuple[str, str]] = (),
|
93
93
|
) -> AnalyzeEntitiesResponse:
|
94
94
|
"""
|
95
|
-
|
95
|
+
Find named entities in the text along with various properties.
|
96
96
|
|
97
97
|
Examples properties: entity types, salience, mentions for each entity, and others.
|
98
98
|
|
@@ -78,7 +78,7 @@ class OSLoginHook(GoogleBaseHook):
|
|
78
78
|
metadata: Sequence[tuple[str, str]] = (),
|
79
79
|
) -> ImportSshPublicKeyResponse:
|
80
80
|
"""
|
81
|
-
|
81
|
+
Add an SSH public key and returns the profile information.
|
82
82
|
|
83
83
|
Default POSIX account information is set when no username and UID exist as part of the login profile.
|
84
84
|
|
@@ -93,7 +93,7 @@ class PubSubHook(GoogleBaseHook):
|
|
93
93
|
|
94
94
|
def get_conn(self) -> PublisherClient:
|
95
95
|
"""
|
96
|
-
|
96
|
+
Retrieve connection to Google Cloud Pub/Sub.
|
97
97
|
|
98
98
|
:return: Google Cloud Pub/Sub client object.
|
99
99
|
"""
|
@@ -118,7 +118,7 @@ class PubSubHook(GoogleBaseHook):
|
|
118
118
|
project_id: str = PROVIDE_PROJECT_ID,
|
119
119
|
) -> None:
|
120
120
|
"""
|
121
|
-
|
121
|
+
Publish messages to a Pub/Sub topic.
|
122
122
|
|
123
123
|
:param topic: the Pub/Sub topic to which to publish; do not
|
124
124
|
include the ``projects/{project}/topics/`` prefix.
|
@@ -191,7 +191,7 @@ class PubSubHook(GoogleBaseHook):
|
|
191
191
|
metadata: Sequence[tuple[str, str]] = (),
|
192
192
|
) -> None:
|
193
193
|
"""
|
194
|
-
|
194
|
+
Create a Pub/Sub topic, if it does not already exist.
|
195
195
|
|
196
196
|
:param topic: the Pub/Sub topic name to create; do not
|
197
197
|
include the ``projects/{project}/topics/`` prefix.
|
@@ -264,7 +264,7 @@ class PubSubHook(GoogleBaseHook):
|
|
264
264
|
metadata: Sequence[tuple[str, str]] = (),
|
265
265
|
) -> None:
|
266
266
|
"""
|
267
|
-
|
267
|
+
Delete a Pub/Sub topic if it exists.
|
268
268
|
|
269
269
|
:param topic: the Pub/Sub topic name to delete; do not
|
270
270
|
include the ``projects/{project}/topics/`` prefix.
|
@@ -318,7 +318,7 @@ class PubSubHook(GoogleBaseHook):
|
|
318
318
|
metadata: Sequence[tuple[str, str]] = (),
|
319
319
|
) -> str:
|
320
320
|
"""
|
321
|
-
|
321
|
+
Create a Pub/Sub subscription, if it does not already exist.
|
322
322
|
|
323
323
|
:param topic: the Pub/Sub topic name that the subscription will be bound
|
324
324
|
to create; do not include the ``projects/{project}/subscriptions/`` prefix.
|
@@ -435,7 +435,7 @@ class PubSubHook(GoogleBaseHook):
|
|
435
435
|
metadata: Sequence[tuple[str, str]] = (),
|
436
436
|
) -> None:
|
437
437
|
"""
|
438
|
-
|
438
|
+
Delete a Pub/Sub subscription, if it exists.
|
439
439
|
|
440
440
|
:param subscription: the Pub/Sub subscription name to delete; do not
|
441
441
|
include the ``projects/{project}/subscriptions/`` prefix.
|
@@ -483,7 +483,7 @@ class PubSubHook(GoogleBaseHook):
|
|
483
483
|
metadata: Sequence[tuple[str, str]] = (),
|
484
484
|
) -> list[ReceivedMessage]:
|
485
485
|
"""
|
486
|
-
|
486
|
+
Pull up to ``max_messages`` messages from Pub/Sub subscription.
|
487
487
|
|
488
488
|
:param subscription: the Pub/Sub subscription name to pull from; do not
|
489
489
|
include the 'projects/{project}/topics/' prefix.
|
@@ -596,7 +596,7 @@ class PubSubAsyncHook(GoogleBaseAsyncHook):
|
|
596
596
|
|
597
597
|
async def _get_subscriber_client(self) -> SubscriberAsyncClient:
|
598
598
|
"""
|
599
|
-
|
599
|
+
Return async connection to the Google PubSub.
|
600
600
|
|
601
601
|
:return: Google Pub/Sub asynchronous client.
|
602
602
|
"""
|
@@ -671,7 +671,7 @@ class PubSubAsyncHook(GoogleBaseAsyncHook):
|
|
671
671
|
metadata: Sequence[tuple[str, str]] = (),
|
672
672
|
) -> list[ReceivedMessage]:
|
673
673
|
"""
|
674
|
-
|
674
|
+
Pull up to ``max_messages`` messages from Pub/Sub subscription.
|
675
675
|
|
676
676
|
:param subscription: the Pub/Sub subscription name to pull from; do not
|
677
677
|
include the 'projects/{project}/topics/' prefix.
|
@@ -76,7 +76,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
76
76
|
|
77
77
|
def _get_client(self, project_id: str) -> Client:
|
78
78
|
"""
|
79
|
-
|
79
|
+
Provide a client for interacting with the Cloud Spanner API.
|
80
80
|
|
81
81
|
:param project_id: The ID of the Google Cloud project.
|
82
82
|
:return: Client
|
@@ -122,7 +122,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
122
122
|
project_id: str,
|
123
123
|
) -> Instance | None:
|
124
124
|
"""
|
125
|
-
|
125
|
+
Get information about a particular instance.
|
126
126
|
|
127
127
|
:param project_id: Optional, The ID of the Google Cloud project that owns the Cloud Spanner
|
128
128
|
database. If set to None or missing, the default project_id from the Google Cloud connection
|
@@ -145,7 +145,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
145
145
|
func: Callable[[Instance], Operation],
|
146
146
|
) -> None:
|
147
147
|
"""
|
148
|
-
|
148
|
+
Invoke a method on a given instance by applying a specified Callable.
|
149
149
|
|
150
150
|
:param project_id: The ID of the Google Cloud project that owns the Cloud Spanner database.
|
151
151
|
:param instance_id: The ID of the instance.
|
@@ -183,7 +183,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
183
183
|
project_id: str,
|
184
184
|
) -> None:
|
185
185
|
"""
|
186
|
-
|
186
|
+
Create a new Cloud Spanner instance.
|
187
187
|
|
188
188
|
:param instance_id: The ID of the Cloud Spanner instance.
|
189
189
|
:param configuration_name: The name of the instance configuration defining how the
|
@@ -213,7 +213,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
213
213
|
project_id: str,
|
214
214
|
) -> None:
|
215
215
|
"""
|
216
|
-
|
216
|
+
Update an existing Cloud Spanner instance.
|
217
217
|
|
218
218
|
:param instance_id: The ID of the Cloud Spanner instance.
|
219
219
|
:param configuration_name: The name of the instance configuration defining how the
|
@@ -236,7 +236,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
236
236
|
@GoogleBaseHook.fallback_to_default_project_id
|
237
237
|
def delete_instance(self, instance_id: str, project_id: str) -> None:
|
238
238
|
"""
|
239
|
-
|
239
|
+
Delete an existing Cloud Spanner instance.
|
240
240
|
|
241
241
|
:param instance_id: The ID of the Cloud Spanner instance.
|
242
242
|
:param project_id: Optional, the ID of the Google Cloud project that owns the Cloud Spanner
|
@@ -260,7 +260,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
260
260
|
project_id: str,
|
261
261
|
) -> Database | None:
|
262
262
|
"""
|
263
|
-
|
263
|
+
Retrieve a database in Cloud Spanner; return None if the database does not exist in the instance.
|
264
264
|
|
265
265
|
:param instance_id: The ID of the Cloud Spanner instance.
|
266
266
|
:param database_id: The ID of the database in Cloud Spanner.
|
@@ -287,7 +287,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
287
287
|
project_id: str,
|
288
288
|
) -> None:
|
289
289
|
"""
|
290
|
-
|
290
|
+
Create a new database in Cloud Spanner.
|
291
291
|
|
292
292
|
:param instance_id: The ID of the Cloud Spanner instance.
|
293
293
|
:param database_id: The ID of the database to create in Cloud Spanner.
|
@@ -321,7 +321,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
321
321
|
operation_id: str | None = None,
|
322
322
|
) -> None:
|
323
323
|
"""
|
324
|
-
|
324
|
+
Update DDL of a database in Cloud Spanner.
|
325
325
|
|
326
326
|
:param instance_id: The ID of the Cloud Spanner instance.
|
327
327
|
:param database_id: The ID of the database in Cloud Spanner.
|
@@ -357,7 +357,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
357
357
|
@GoogleBaseHook.fallback_to_default_project_id
|
358
358
|
def delete_database(self, instance_id: str, database_id, project_id: str) -> bool:
|
359
359
|
"""
|
360
|
-
|
360
|
+
Drop a database in Cloud Spanner.
|
361
361
|
|
362
362
|
:param instance_id: The ID of the Cloud Spanner instance.
|
363
363
|
:param database_id: The ID of the database in Cloud Spanner.
|
@@ -392,7 +392,7 @@ class SpannerHook(GoogleBaseHook, DbApiHook):
|
|
392
392
|
project_id: str,
|
393
393
|
) -> None:
|
394
394
|
"""
|
395
|
-
|
395
|
+
Execute an arbitrary DML query (INSERT, UPDATE, DELETE).
|
396
396
|
|
397
397
|
:param instance_id: The ID of the Cloud Spanner instance.
|
398
398
|
:param database_id: The ID of the database in Cloud Spanner.
|
@@ -80,7 +80,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
80
80
|
metadata: Sequence[tuple[str, str]] = (),
|
81
81
|
) -> Any:
|
82
82
|
"""
|
83
|
-
|
83
|
+
Fetch all the Alert Policies identified by the filter passed as filter parameter.
|
84
84
|
|
85
85
|
The desired return type can be specified by the format parameter, the supported formats
|
86
86
|
are "dict", "json" and None which returns python dictionary, stringified JSON and protobuf
|
@@ -161,7 +161,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
161
161
|
metadata: Sequence[tuple[str, str]] = (),
|
162
162
|
) -> None:
|
163
163
|
"""
|
164
|
-
|
164
|
+
Enable one or more disabled alerting policies identified by filter parameter.
|
165
165
|
|
166
166
|
Inoperative in case the policy is already enabled.
|
167
167
|
|
@@ -229,7 +229,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
229
229
|
metadata: Sequence[tuple[str, str]] = (),
|
230
230
|
) -> None:
|
231
231
|
"""
|
232
|
-
|
232
|
+
Create a new alert or updates an existing policy identified the name field in the alerts parameter.
|
233
233
|
|
234
234
|
:param project_id: The project in which alert needs to be created/updated.
|
235
235
|
:param alerts: A JSON string or file that specifies all the alerts that needs
|
@@ -322,7 +322,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
322
322
|
metadata: Sequence[tuple[str, str]] = (),
|
323
323
|
) -> None:
|
324
324
|
"""
|
325
|
-
|
325
|
+
Delete an alerting policy.
|
326
326
|
|
327
327
|
:param name: The alerting policy to delete. The format is:
|
328
328
|
``projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]``.
|
@@ -354,7 +354,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
354
354
|
metadata: Sequence[tuple[str, str]] = (),
|
355
355
|
) -> Any:
|
356
356
|
"""
|
357
|
-
|
357
|
+
Fetch all the Notification Channels identified by the filter passed as filter parameter.
|
358
358
|
|
359
359
|
The desired return type can be specified by the format parameter, the supported formats are
|
360
360
|
"dict", "json" and None which returns python dictionary, stringified JSON and protobuf
|
@@ -437,7 +437,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
437
437
|
metadata: Sequence[tuple[str, str]] = (),
|
438
438
|
) -> None:
|
439
439
|
"""
|
440
|
-
|
440
|
+
Enable one or more disabled alerting policies identified by filter parameter.
|
441
441
|
|
442
442
|
Inoperative in case the policy is already enabled.
|
443
443
|
|
@@ -567,7 +567,7 @@ class StackdriverHook(GoogleBaseHook):
|
|
567
567
|
metadata: Sequence[tuple[str, str]] = (),
|
568
568
|
) -> None:
|
569
569
|
"""
|
570
|
-
|
570
|
+
Delete a notification channel.
|
571
571
|
|
572
572
|
:param name: The alerting policy to delete. The format is:
|
573
573
|
``projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]``.
|
@@ -73,7 +73,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
73
73
|
|
74
74
|
def get_conn(self) -> CloudTasksClient:
|
75
75
|
"""
|
76
|
-
|
76
|
+
Provide a client for interacting with the Google Cloud Tasks API.
|
77
77
|
|
78
78
|
:return: Google Cloud Tasks API Client
|
79
79
|
"""
|
@@ -93,7 +93,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
93
93
|
metadata: Sequence[tuple[str, str]] = (),
|
94
94
|
) -> Queue:
|
95
95
|
"""
|
96
|
-
|
96
|
+
Create a queue in Cloud Tasks.
|
97
97
|
|
98
98
|
:param location: The location name in which the queue will be created.
|
99
99
|
:param task_queue: The task queue to create.
|
@@ -141,7 +141,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
141
141
|
metadata: Sequence[tuple[str, str]] = (),
|
142
142
|
) -> Queue:
|
143
143
|
"""
|
144
|
-
|
144
|
+
Update a queue in Cloud Tasks.
|
145
145
|
|
146
146
|
:param task_queue: The task queue to update.
|
147
147
|
This method creates the queue if it does not exist and updates the queue if
|
@@ -190,7 +190,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
190
190
|
metadata: Sequence[tuple[str, str]] = (),
|
191
191
|
) -> Queue:
|
192
192
|
"""
|
193
|
-
|
193
|
+
Get a queue from Cloud Tasks.
|
194
194
|
|
195
195
|
:param location: The location name in which the queue was created.
|
196
196
|
:param queue_name: The queue's name.
|
@@ -225,7 +225,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
225
225
|
metadata: Sequence[tuple[str, str]] = (),
|
226
226
|
) -> list[Queue]:
|
227
227
|
"""
|
228
|
-
|
228
|
+
List queues from Cloud Tasks.
|
229
229
|
|
230
230
|
:param location: The location name in which the queues were created.
|
231
231
|
:param project_id: (Optional) The ID of the Google Cloud project that owns the Cloud Tasks.
|
@@ -262,7 +262,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
262
262
|
metadata: Sequence[tuple[str, str]] = (),
|
263
263
|
) -> None:
|
264
264
|
"""
|
265
|
-
|
265
|
+
Delete a queue from Cloud Tasks, even if it has tasks in it.
|
266
266
|
|
267
267
|
:param location: The location name in which the queue will be deleted.
|
268
268
|
:param queue_name: The queue's name.
|
@@ -401,7 +401,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
401
401
|
metadata: Sequence[tuple[str, str]] = (),
|
402
402
|
) -> Task:
|
403
403
|
"""
|
404
|
-
|
404
|
+
Create a task in Cloud Tasks.
|
405
405
|
|
406
406
|
:param location: The location name in which the task will be created.
|
407
407
|
:param queue_name: The queue's name.
|
@@ -453,7 +453,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
453
453
|
metadata: Sequence[tuple[str, str]] = (),
|
454
454
|
) -> Task:
|
455
455
|
"""
|
456
|
-
|
456
|
+
Get a task from Cloud Tasks.
|
457
457
|
|
458
458
|
:param location: The location name in which the task was created.
|
459
459
|
:param queue_name: The queue's name.
|
@@ -492,7 +492,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
492
492
|
metadata: Sequence[tuple[str, str]] = (),
|
493
493
|
) -> list[Task]:
|
494
494
|
"""
|
495
|
-
|
495
|
+
List the tasks in Cloud Tasks.
|
496
496
|
|
497
497
|
:param location: The location name in which the tasks were created.
|
498
498
|
:param queue_name: The queue's name.
|
@@ -531,7 +531,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
531
531
|
metadata: Sequence[tuple[str, str]] = (),
|
532
532
|
) -> None:
|
533
533
|
"""
|
534
|
-
|
534
|
+
Delete a task from Cloud Tasks.
|
535
535
|
|
536
536
|
:param location: The location name in which the task will be deleted.
|
537
537
|
:param queue_name: The queue's name.
|
@@ -568,7 +568,7 @@ class CloudTasksHook(GoogleBaseHook):
|
|
568
568
|
metadata: Sequence[tuple[str, str]] = (),
|
569
569
|
) -> Task:
|
570
570
|
"""
|
571
|
-
|
571
|
+
Force run a task in Cloud Tasks.
|
572
572
|
|
573
573
|
:param location: The location name in which the task was created.
|
574
574
|
:param queue_name: The queue's name.
|
@@ -73,7 +73,7 @@ class CloudTextToSpeechHook(GoogleBaseHook):
|
|
73
73
|
|
74
74
|
def get_conn(self) -> TextToSpeechClient:
|
75
75
|
"""
|
76
|
-
|
76
|
+
Retrieve connection to Cloud Text to Speech.
|
77
77
|
|
78
78
|
:return: Google Cloud Text to Speech client object.
|
79
79
|
"""
|
@@ -74,7 +74,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
74
74
|
self,
|
75
75
|
region: str | None = None,
|
76
76
|
) -> PipelineServiceClient:
|
77
|
-
"""
|
77
|
+
"""Return PipelineServiceClient."""
|
78
78
|
if region and region != "global":
|
79
79
|
client_options = ClientOptions(api_endpoint=f"{region}-aiplatform.googleapis.com:443")
|
80
80
|
else:
|
@@ -88,7 +88,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
88
88
|
self,
|
89
89
|
region: str | None = None,
|
90
90
|
) -> JobServiceClient:
|
91
|
-
"""
|
91
|
+
"""Return JobServiceClient."""
|
92
92
|
if region and region != "global":
|
93
93
|
client_options = ClientOptions(api_endpoint=f"{region}-aiplatform.googleapis.com:443")
|
94
94
|
else:
|
@@ -113,7 +113,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
113
113
|
training_encryption_spec_key_name: str | None = None,
|
114
114
|
model_encryption_spec_key_name: str | None = None,
|
115
115
|
) -> AutoMLTabularTrainingJob:
|
116
|
-
"""
|
116
|
+
"""Return AutoMLTabularTrainingJob object."""
|
117
117
|
return AutoMLTabularTrainingJob(
|
118
118
|
display_name=display_name,
|
119
119
|
optimization_prediction_type=optimization_prediction_type,
|
@@ -142,7 +142,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
142
142
|
training_encryption_spec_key_name: str | None = None,
|
143
143
|
model_encryption_spec_key_name: str | None = None,
|
144
144
|
) -> AutoMLForecastingTrainingJob:
|
145
|
-
"""
|
145
|
+
"""Return AutoMLForecastingTrainingJob object."""
|
146
146
|
return AutoMLForecastingTrainingJob(
|
147
147
|
display_name=display_name,
|
148
148
|
optimization_objective=optimization_objective,
|
@@ -169,7 +169,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
169
169
|
training_encryption_spec_key_name: str | None = None,
|
170
170
|
model_encryption_spec_key_name: str | None = None,
|
171
171
|
) -> AutoMLImageTrainingJob:
|
172
|
-
"""
|
172
|
+
"""Return AutoMLImageTrainingJob object."""
|
173
173
|
return AutoMLImageTrainingJob(
|
174
174
|
display_name=display_name,
|
175
175
|
prediction_type=prediction_type,
|
@@ -196,7 +196,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
196
196
|
training_encryption_spec_key_name: str | None = None,
|
197
197
|
model_encryption_spec_key_name: str | None = None,
|
198
198
|
) -> AutoMLTextTrainingJob:
|
199
|
-
"""
|
199
|
+
"""Return AutoMLTextTrainingJob object."""
|
200
200
|
return AutoMLTextTrainingJob(
|
201
201
|
display_name=display_name,
|
202
202
|
prediction_type=prediction_type,
|
@@ -221,7 +221,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
221
221
|
training_encryption_spec_key_name: str | None = None,
|
222
222
|
model_encryption_spec_key_name: str | None = None,
|
223
223
|
) -> AutoMLVideoTrainingJob:
|
224
|
-
"""
|
224
|
+
"""Return AutoMLVideoTrainingJob object."""
|
225
225
|
return AutoMLVideoTrainingJob(
|
226
226
|
display_name=display_name,
|
227
227
|
prediction_type=prediction_type,
|
@@ -236,16 +236,16 @@ class AutoMLHook(GoogleBaseHook):
|
|
236
236
|
|
237
237
|
@staticmethod
|
238
238
|
def extract_model_id(obj: dict) -> str:
|
239
|
-
"""
|
239
|
+
"""Return unique id of the Model."""
|
240
240
|
return obj["name"].rpartition("/")[-1]
|
241
241
|
|
242
242
|
@staticmethod
|
243
243
|
def extract_training_id(resource_name: str) -> str:
|
244
|
-
"""
|
244
|
+
"""Return unique id of the Training pipeline."""
|
245
245
|
return resource_name.rpartition("/")[-1]
|
246
246
|
|
247
247
|
def wait_for_operation(self, operation: Operation, timeout: float | None = None):
|
248
|
-
"""
|
248
|
+
"""Wait for long-lasting operation to complete."""
|
249
249
|
try:
|
250
250
|
return operation.result(timeout=timeout)
|
251
251
|
except Exception:
|
@@ -1301,7 +1301,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
1301
1301
|
metadata: Sequence[tuple[str, str]] = (),
|
1302
1302
|
) -> Operation:
|
1303
1303
|
"""
|
1304
|
-
|
1304
|
+
Delete a TrainingPipeline.
|
1305
1305
|
|
1306
1306
|
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
|
1307
1307
|
:param region: Required. The ID of the Google Cloud region that the service belongs to.
|
@@ -1334,7 +1334,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
1334
1334
|
metadata: Sequence[tuple[str, str]] = (),
|
1335
1335
|
) -> TrainingPipeline:
|
1336
1336
|
"""
|
1337
|
-
|
1337
|
+
Get a TrainingPipeline.
|
1338
1338
|
|
1339
1339
|
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
|
1340
1340
|
:param region: Required. The ID of the Google Cloud region that the service belongs to.
|
@@ -1370,7 +1370,7 @@ class AutoMLHook(GoogleBaseHook):
|
|
1370
1370
|
metadata: Sequence[tuple[str, str]] = (),
|
1371
1371
|
) -> ListTrainingPipelinesPager:
|
1372
1372
|
"""
|
1373
|
-
|
1373
|
+
List TrainingPipelines in a Location.
|
1374
1374
|
|
1375
1375
|
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
|
1376
1376
|
:param region: Required. The ID of the Google Cloud region that the service belongs to.
|