apache-airflow-providers-google 16.0.0a1__py3-none-any.whl → 16.1.0__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 +43 -5
- airflow/providers/google/ads/operators/ads.py +1 -1
- airflow/providers/google/ads/transfers/ads_to_gcs.py +1 -1
- airflow/providers/google/cloud/hooks/bigquery.py +63 -77
- airflow/providers/google/cloud/hooks/cloud_sql.py +8 -4
- airflow/providers/google/cloud/hooks/datacatalog.py +9 -1
- airflow/providers/google/cloud/hooks/dataflow.py +2 -2
- airflow/providers/google/cloud/hooks/dataplex.py +1 -1
- airflow/providers/google/cloud/hooks/dataprep.py +4 -1
- airflow/providers/google/cloud/hooks/gcs.py +5 -5
- airflow/providers/google/cloud/hooks/looker.py +10 -1
- airflow/providers/google/cloud/hooks/mlengine.py +2 -1
- airflow/providers/google/cloud/hooks/secret_manager.py +102 -10
- airflow/providers/google/cloud/hooks/spanner.py +2 -2
- airflow/providers/google/cloud/hooks/translate.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +0 -36
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +307 -7
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +44 -80
- airflow/providers/google/cloud/hooks/vertex_ai/ray.py +11 -2
- airflow/providers/google/cloud/hooks/vision.py +2 -2
- airflow/providers/google/cloud/links/alloy_db.py +0 -46
- airflow/providers/google/cloud/links/base.py +75 -11
- airflow/providers/google/cloud/links/bigquery.py +0 -47
- airflow/providers/google/cloud/links/bigquery_dts.py +0 -20
- airflow/providers/google/cloud/links/bigtable.py +0 -48
- airflow/providers/google/cloud/links/cloud_build.py +0 -73
- airflow/providers/google/cloud/links/cloud_functions.py +0 -33
- airflow/providers/google/cloud/links/cloud_memorystore.py +0 -58
- airflow/providers/google/cloud/links/cloud_run.py +27 -0
- airflow/providers/google/cloud/links/cloud_sql.py +0 -33
- airflow/providers/google/cloud/links/cloud_storage_transfer.py +16 -43
- airflow/providers/google/cloud/links/cloud_tasks.py +6 -25
- airflow/providers/google/cloud/links/compute.py +0 -58
- airflow/providers/google/cloud/links/data_loss_prevention.py +0 -169
- airflow/providers/google/cloud/links/datacatalog.py +23 -54
- airflow/providers/google/cloud/links/dataflow.py +0 -34
- airflow/providers/google/cloud/links/dataform.py +0 -64
- airflow/providers/google/cloud/links/datafusion.py +1 -96
- airflow/providers/google/cloud/links/dataplex.py +0 -154
- airflow/providers/google/cloud/links/dataprep.py +0 -24
- airflow/providers/google/cloud/links/dataproc.py +14 -90
- airflow/providers/google/cloud/links/datastore.py +0 -31
- airflow/providers/google/cloud/links/kubernetes_engine.py +5 -59
- airflow/providers/google/cloud/links/life_sciences.py +0 -19
- airflow/providers/google/cloud/links/managed_kafka.py +0 -70
- airflow/providers/google/cloud/links/mlengine.py +0 -70
- airflow/providers/google/cloud/links/pubsub.py +0 -32
- airflow/providers/google/cloud/links/spanner.py +0 -33
- airflow/providers/google/cloud/links/stackdriver.py +0 -30
- airflow/providers/google/cloud/links/translate.py +16 -186
- airflow/providers/google/cloud/links/vertex_ai.py +8 -224
- airflow/providers/google/cloud/links/workflows.py +0 -52
- airflow/providers/google/cloud/log/gcs_task_handler.py +4 -4
- airflow/providers/google/cloud/operators/alloy_db.py +69 -54
- airflow/providers/google/cloud/operators/automl.py +16 -14
- airflow/providers/google/cloud/operators/bigquery.py +49 -25
- airflow/providers/google/cloud/operators/bigquery_dts.py +2 -4
- airflow/providers/google/cloud/operators/bigtable.py +35 -6
- airflow/providers/google/cloud/operators/cloud_base.py +21 -1
- airflow/providers/google/cloud/operators/cloud_build.py +74 -31
- airflow/providers/google/cloud/operators/cloud_composer.py +34 -35
- airflow/providers/google/cloud/operators/cloud_memorystore.py +68 -42
- airflow/providers/google/cloud/operators/cloud_run.py +9 -1
- airflow/providers/google/cloud/operators/cloud_sql.py +11 -15
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +0 -2
- airflow/providers/google/cloud/operators/compute.py +7 -39
- airflow/providers/google/cloud/operators/datacatalog.py +156 -20
- airflow/providers/google/cloud/operators/dataflow.py +37 -14
- airflow/providers/google/cloud/operators/dataform.py +14 -4
- airflow/providers/google/cloud/operators/datafusion.py +4 -12
- airflow/providers/google/cloud/operators/dataplex.py +180 -96
- airflow/providers/google/cloud/operators/dataprep.py +0 -4
- airflow/providers/google/cloud/operators/dataproc.py +10 -16
- airflow/providers/google/cloud/operators/dataproc_metastore.py +95 -87
- airflow/providers/google/cloud/operators/datastore.py +21 -5
- airflow/providers/google/cloud/operators/dlp.py +3 -26
- airflow/providers/google/cloud/operators/functions.py +15 -6
- airflow/providers/google/cloud/operators/gcs.py +1 -7
- airflow/providers/google/cloud/operators/kubernetes_engine.py +53 -92
- airflow/providers/google/cloud/operators/life_sciences.py +0 -1
- airflow/providers/google/cloud/operators/managed_kafka.py +106 -51
- airflow/providers/google/cloud/operators/mlengine.py +0 -1
- airflow/providers/google/cloud/operators/pubsub.py +4 -5
- airflow/providers/google/cloud/operators/spanner.py +0 -4
- airflow/providers/google/cloud/operators/speech_to_text.py +0 -1
- airflow/providers/google/cloud/operators/stackdriver.py +0 -8
- airflow/providers/google/cloud/operators/tasks.py +0 -11
- airflow/providers/google/cloud/operators/text_to_speech.py +0 -1
- airflow/providers/google/cloud/operators/translate.py +37 -13
- airflow/providers/google/cloud/operators/translate_speech.py +0 -1
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +31 -18
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +28 -8
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +38 -25
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +69 -7
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +42 -8
- airflow/providers/google/cloud/operators/vertex_ai/feature_store.py +531 -0
- airflow/providers/google/cloud/operators/vertex_ai/generative_model.py +93 -117
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +10 -8
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +56 -10
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +29 -6
- airflow/providers/google/cloud/operators/vertex_ai/ray.py +9 -6
- airflow/providers/google/cloud/operators/workflows.py +1 -9
- airflow/providers/google/cloud/sensors/bigquery.py +1 -1
- airflow/providers/google/cloud/sensors/bigquery_dts.py +6 -1
- airflow/providers/google/cloud/sensors/bigtable.py +15 -3
- airflow/providers/google/cloud/sensors/cloud_composer.py +6 -1
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +6 -1
- airflow/providers/google/cloud/sensors/dataflow.py +3 -3
- airflow/providers/google/cloud/sensors/dataform.py +6 -1
- airflow/providers/google/cloud/sensors/datafusion.py +6 -1
- airflow/providers/google/cloud/sensors/dataplex.py +6 -1
- airflow/providers/google/cloud/sensors/dataprep.py +6 -1
- airflow/providers/google/cloud/sensors/dataproc.py +6 -1
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +6 -1
- airflow/providers/google/cloud/sensors/gcs.py +9 -3
- airflow/providers/google/cloud/sensors/looker.py +6 -1
- airflow/providers/google/cloud/sensors/pubsub.py +8 -3
- airflow/providers/google/cloud/sensors/tasks.py +6 -1
- airflow/providers/google/cloud/sensors/vertex_ai/feature_store.py +6 -1
- airflow/providers/google/cloud/sensors/workflows.py +6 -1
- airflow/providers/google/cloud/transfers/azure_blob_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +10 -7
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +1 -2
- airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +0 -1
- airflow/providers/google/cloud/transfers/bigquery_to_sql.py +1 -1
- airflow/providers/google/cloud/transfers/calendar_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +1 -2
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/gcs_to_local.py +1 -1
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +1 -1
- airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +5 -1
- airflow/providers/google/cloud/transfers/gdrive_to_local.py +1 -1
- airflow/providers/google/cloud/transfers/http_to_gcs.py +193 -0
- airflow/providers/google/cloud/transfers/local_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +11 -5
- airflow/providers/google/cloud/transfers/salesforce_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/sheets_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +1 -1
- airflow/providers/google/cloud/triggers/bigquery.py +32 -5
- airflow/providers/google/cloud/triggers/dataproc.py +62 -10
- airflow/providers/google/cloud/utils/field_validator.py +1 -2
- airflow/providers/google/common/auth_backend/google_openid.py +2 -1
- airflow/providers/google/common/deprecated.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +7 -3
- airflow/providers/google/common/links/storage.py +0 -22
- airflow/providers/google/firebase/operators/firestore.py +1 -1
- airflow/providers/google/get_provider_info.py +14 -16
- airflow/providers/google/leveldb/hooks/leveldb.py +30 -1
- airflow/providers/google/leveldb/operators/leveldb.py +1 -1
- airflow/providers/google/marketing_platform/links/analytics_admin.py +3 -6
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +0 -1
- airflow/providers/google/marketing_platform/operators/campaign_manager.py +4 -4
- airflow/providers/google/marketing_platform/operators/display_video.py +6 -6
- airflow/providers/google/marketing_platform/operators/search_ads.py +1 -1
- airflow/providers/google/marketing_platform/sensors/campaign_manager.py +6 -1
- airflow/providers/google/marketing_platform/sensors/display_video.py +6 -1
- airflow/providers/google/suite/operators/sheets.py +3 -3
- airflow/providers/google/suite/sensors/drive.py +6 -1
- airflow/providers/google/suite/transfers/gcs_to_gdrive.py +1 -1
- airflow/providers/google/suite/transfers/gcs_to_sheets.py +1 -1
- airflow/providers/google/suite/transfers/local_to_drive.py +1 -1
- airflow/providers/google/version_compat.py +28 -0
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/METADATA +35 -35
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/RECORD +171 -170
- airflow/providers/google/cloud/links/automl.py +0 -193
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/entry_points.txt +0 -0
@@ -21,7 +21,7 @@ from __future__ import annotations
|
|
21
21
|
|
22
22
|
from collections.abc import Sequence
|
23
23
|
from functools import cached_property
|
24
|
-
from typing import TYPE_CHECKING
|
24
|
+
from typing import TYPE_CHECKING, Any
|
25
25
|
|
26
26
|
from google.api_core.exceptions import AlreadyExists, NotFound
|
27
27
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
@@ -150,9 +150,17 @@ class ManagedKafkaCreateClusterOperator(ManagedKafkaBaseOperator):
|
|
150
150
|
self.cluster_id = cluster_id
|
151
151
|
self.request_id = request_id
|
152
152
|
|
153
|
+
@property
|
154
|
+
def extra_links_params(self) -> dict[str, Any]:
|
155
|
+
return {
|
156
|
+
"location": self.location,
|
157
|
+
"cluster_id": self.cluster_id,
|
158
|
+
"project_id": self.project_id,
|
159
|
+
}
|
160
|
+
|
153
161
|
def execute(self, context: Context):
|
154
162
|
self.log.info("Creating an Apache Kafka cluster.")
|
155
|
-
ApacheKafkaClusterLink.persist(context=context
|
163
|
+
ApacheKafkaClusterLink.persist(context=context)
|
156
164
|
try:
|
157
165
|
operation = self.hook.create_cluster(
|
158
166
|
project_id=self.project_id,
|
@@ -227,8 +235,14 @@ class ManagedKafkaListClustersOperator(ManagedKafkaBaseOperator):
|
|
227
235
|
self.filter = filter
|
228
236
|
self.order_by = order_by
|
229
237
|
|
238
|
+
@property
|
239
|
+
def extra_links_params(self) -> dict[str, Any]:
|
240
|
+
return {
|
241
|
+
"project_id": self.project_id,
|
242
|
+
}
|
243
|
+
|
230
244
|
def execute(self, context: Context):
|
231
|
-
ApacheKafkaClusterListLink.persist(context=context
|
245
|
+
ApacheKafkaClusterListLink.persist(context=context)
|
232
246
|
self.log.info("Listing Clusters from location %s.", self.location)
|
233
247
|
try:
|
234
248
|
cluster_list_pager = self.hook.list_clusters(
|
@@ -242,8 +256,7 @@ class ManagedKafkaListClustersOperator(ManagedKafkaBaseOperator):
|
|
242
256
|
timeout=self.timeout,
|
243
257
|
metadata=self.metadata,
|
244
258
|
)
|
245
|
-
|
246
|
-
context=context,
|
259
|
+
context["ti"].xcom_push(
|
247
260
|
key="cluster_page",
|
248
261
|
value=types.ListClustersResponse.to_dict(cluster_list_pager._response),
|
249
262
|
)
|
@@ -285,12 +298,16 @@ class ManagedKafkaGetClusterOperator(ManagedKafkaBaseOperator):
|
|
285
298
|
super().__init__(*args, **kwargs)
|
286
299
|
self.cluster_id = cluster_id
|
287
300
|
|
301
|
+
@property
|
302
|
+
def extra_links_params(self) -> dict[str, Any]:
|
303
|
+
return {
|
304
|
+
"location": self.location,
|
305
|
+
"cluster_id": self.cluster_id,
|
306
|
+
"project_id": self.project_id,
|
307
|
+
}
|
308
|
+
|
288
309
|
def execute(self, context: Context):
|
289
|
-
ApacheKafkaClusterLink.persist(
|
290
|
-
context=context,
|
291
|
-
task_instance=self,
|
292
|
-
cluster_id=self.cluster_id,
|
293
|
-
)
|
310
|
+
ApacheKafkaClusterLink.persist(context=context)
|
294
311
|
self.log.info("Getting Cluster: %s", self.cluster_id)
|
295
312
|
try:
|
296
313
|
cluster = self.hook.get_cluster(
|
@@ -362,12 +379,16 @@ class ManagedKafkaUpdateClusterOperator(ManagedKafkaBaseOperator):
|
|
362
379
|
self.update_mask = update_mask
|
363
380
|
self.request_id = request_id
|
364
381
|
|
382
|
+
@property
|
383
|
+
def extra_links_params(self) -> dict[str, Any]:
|
384
|
+
return {
|
385
|
+
"location": self.location,
|
386
|
+
"cluster_id": self.cluster_id,
|
387
|
+
"project_id": self.project_id,
|
388
|
+
}
|
389
|
+
|
365
390
|
def execute(self, context: Context):
|
366
|
-
ApacheKafkaClusterLink.persist(
|
367
|
-
context=context,
|
368
|
-
task_instance=self,
|
369
|
-
cluster_id=self.cluster_id,
|
370
|
-
)
|
391
|
+
ApacheKafkaClusterLink.persist(context=context)
|
371
392
|
self.log.info("Updating an Apache Kafka cluster.")
|
372
393
|
try:
|
373
394
|
operation = self.hook.update_cluster(
|
@@ -497,14 +518,18 @@ class ManagedKafkaCreateTopicOperator(ManagedKafkaBaseOperator):
|
|
497
518
|
self.topic_id = topic_id
|
498
519
|
self.topic = topic
|
499
520
|
|
521
|
+
@property
|
522
|
+
def extra_links_params(self) -> dict[str, Any]:
|
523
|
+
return {
|
524
|
+
"location": self.location,
|
525
|
+
"cluster_id": self.cluster_id,
|
526
|
+
"topic_id": self.topic_id,
|
527
|
+
"project_id": self.project_id,
|
528
|
+
}
|
529
|
+
|
500
530
|
def execute(self, context: Context):
|
501
531
|
self.log.info("Creating an Apache Kafka topic.")
|
502
|
-
ApacheKafkaTopicLink.persist(
|
503
|
-
context=context,
|
504
|
-
task_instance=self,
|
505
|
-
cluster_id=self.cluster_id,
|
506
|
-
topic_id=self.topic_id,
|
507
|
-
)
|
532
|
+
ApacheKafkaTopicLink.persist(context=context)
|
508
533
|
try:
|
509
534
|
topic_obj = self.hook.create_topic(
|
510
535
|
project_id=self.project_id,
|
@@ -574,8 +599,16 @@ class ManagedKafkaListTopicsOperator(ManagedKafkaBaseOperator):
|
|
574
599
|
self.page_size = page_size
|
575
600
|
self.page_token = page_token
|
576
601
|
|
602
|
+
@property
|
603
|
+
def extra_links_params(self) -> dict[str, Any]:
|
604
|
+
return {
|
605
|
+
"location": self.location,
|
606
|
+
"cluster_id": self.cluster_id,
|
607
|
+
"project_id": self.project_id,
|
608
|
+
}
|
609
|
+
|
577
610
|
def execute(self, context: Context):
|
578
|
-
ApacheKafkaClusterLink.persist(context=context
|
611
|
+
ApacheKafkaClusterLink.persist(context=context)
|
579
612
|
self.log.info("Listing Topics for cluster %s.", self.cluster_id)
|
580
613
|
try:
|
581
614
|
topic_list_pager = self.hook.list_topics(
|
@@ -588,8 +621,7 @@ class ManagedKafkaListTopicsOperator(ManagedKafkaBaseOperator):
|
|
588
621
|
timeout=self.timeout,
|
589
622
|
metadata=self.metadata,
|
590
623
|
)
|
591
|
-
|
592
|
-
context=context,
|
624
|
+
context["ti"].xcom_push(
|
593
625
|
key="topic_page",
|
594
626
|
value=types.ListTopicsResponse.to_dict(topic_list_pager._response),
|
595
627
|
)
|
@@ -636,13 +668,17 @@ class ManagedKafkaGetTopicOperator(ManagedKafkaBaseOperator):
|
|
636
668
|
self.cluster_id = cluster_id
|
637
669
|
self.topic_id = topic_id
|
638
670
|
|
671
|
+
@property
|
672
|
+
def extra_links_params(self) -> dict[str, Any]:
|
673
|
+
return {
|
674
|
+
"location": self.location,
|
675
|
+
"cluster_id": self.cluster_id,
|
676
|
+
"topic_id": self.topic_id,
|
677
|
+
"project_id": self.project_id,
|
678
|
+
}
|
679
|
+
|
639
680
|
def execute(self, context: Context):
|
640
|
-
ApacheKafkaTopicLink.persist(
|
641
|
-
context=context,
|
642
|
-
task_instance=self,
|
643
|
-
cluster_id=self.cluster_id,
|
644
|
-
topic_id=self.topic_id,
|
645
|
-
)
|
681
|
+
ApacheKafkaTopicLink.persist(context=context)
|
646
682
|
self.log.info("Getting Topic: %s", self.topic_id)
|
647
683
|
try:
|
648
684
|
topic = self.hook.get_topic(
|
@@ -707,13 +743,17 @@ class ManagedKafkaUpdateTopicOperator(ManagedKafkaBaseOperator):
|
|
707
743
|
self.topic = topic
|
708
744
|
self.update_mask = update_mask
|
709
745
|
|
746
|
+
@property
|
747
|
+
def extra_links_params(self) -> dict[str, Any]:
|
748
|
+
return {
|
749
|
+
"location": self.location,
|
750
|
+
"cluster_id": self.cluster_id,
|
751
|
+
"topic_id": self.topic_id,
|
752
|
+
"project_id": self.project_id,
|
753
|
+
}
|
754
|
+
|
710
755
|
def execute(self, context: Context):
|
711
|
-
ApacheKafkaTopicLink.persist(
|
712
|
-
context=context,
|
713
|
-
task_instance=self,
|
714
|
-
cluster_id=self.cluster_id,
|
715
|
-
topic_id=self.topic_id,
|
716
|
-
)
|
756
|
+
ApacheKafkaTopicLink.persist(context=context)
|
717
757
|
self.log.info("Updating an Apache Kafka topic.")
|
718
758
|
try:
|
719
759
|
topic_obj = self.hook.update_topic(
|
@@ -833,8 +873,16 @@ class ManagedKafkaListConsumerGroupsOperator(ManagedKafkaBaseOperator):
|
|
833
873
|
self.page_size = page_size
|
834
874
|
self.page_token = page_token
|
835
875
|
|
876
|
+
@property
|
877
|
+
def extra_links_params(self) -> dict[str, Any]:
|
878
|
+
return {
|
879
|
+
"location": self.location,
|
880
|
+
"cluster_id": self.cluster_id,
|
881
|
+
"project_id": self.project_id,
|
882
|
+
}
|
883
|
+
|
836
884
|
def execute(self, context: Context):
|
837
|
-
ApacheKafkaClusterLink.persist(context=context
|
885
|
+
ApacheKafkaClusterLink.persist(context=context)
|
838
886
|
self.log.info("Listing Consumer Groups for cluster %s.", self.cluster_id)
|
839
887
|
try:
|
840
888
|
consumer_group_list_pager = self.hook.list_consumer_groups(
|
@@ -847,8 +895,7 @@ class ManagedKafkaListConsumerGroupsOperator(ManagedKafkaBaseOperator):
|
|
847
895
|
timeout=self.timeout,
|
848
896
|
metadata=self.metadata,
|
849
897
|
)
|
850
|
-
|
851
|
-
context=context,
|
898
|
+
context["ti"].xcom_push(
|
852
899
|
key="consumer_group_page",
|
853
900
|
value=types.ListConsumerGroupsResponse.to_dict(consumer_group_list_pager._response),
|
854
901
|
)
|
@@ -895,13 +942,17 @@ class ManagedKafkaGetConsumerGroupOperator(ManagedKafkaBaseOperator):
|
|
895
942
|
self.cluster_id = cluster_id
|
896
943
|
self.consumer_group_id = consumer_group_id
|
897
944
|
|
945
|
+
@property
|
946
|
+
def extra_links_params(self) -> dict[str, Any]:
|
947
|
+
return {
|
948
|
+
"location": self.location,
|
949
|
+
"cluster_id": self.cluster_id,
|
950
|
+
"consumer_group_id": self.consumer_group_id,
|
951
|
+
"project_id": self.project_id,
|
952
|
+
}
|
953
|
+
|
898
954
|
def execute(self, context: Context):
|
899
|
-
ApacheKafkaConsumerGroupLink.persist(
|
900
|
-
context=context,
|
901
|
-
task_instance=self,
|
902
|
-
cluster_id=self.cluster_id,
|
903
|
-
consumer_group_id=self.consumer_group_id,
|
904
|
-
)
|
955
|
+
ApacheKafkaConsumerGroupLink.persist(context=context)
|
905
956
|
self.log.info("Getting Consumer Group: %s", self.consumer_group_id)
|
906
957
|
try:
|
907
958
|
consumer_group = self.hook.get_consumer_group(
|
@@ -971,13 +1022,17 @@ class ManagedKafkaUpdateConsumerGroupOperator(ManagedKafkaBaseOperator):
|
|
971
1022
|
self.consumer_group = consumer_group
|
972
1023
|
self.update_mask = update_mask
|
973
1024
|
|
1025
|
+
@property
|
1026
|
+
def extra_links_params(self) -> dict[str, Any]:
|
1027
|
+
return {
|
1028
|
+
"location": self.location,
|
1029
|
+
"cluster_id": self.cluster_id,
|
1030
|
+
"consumer_group_id": self.consumer_group_id,
|
1031
|
+
"project_id": self.project_id,
|
1032
|
+
}
|
1033
|
+
|
974
1034
|
def execute(self, context: Context):
|
975
|
-
ApacheKafkaConsumerGroupLink.persist(
|
976
|
-
context=context,
|
977
|
-
task_instance=self,
|
978
|
-
cluster_id=self.cluster_id,
|
979
|
-
consumer_group_id=self.consumer_group_id,
|
980
|
-
)
|
1035
|
+
ApacheKafkaConsumerGroupLink.persist(context=context)
|
981
1036
|
self.log.info("Updating an Apache Kafka consumer group.")
|
982
1037
|
try:
|
983
1038
|
consumer_group_obj = self.hook.update_consumer_group(
|
@@ -25,8 +25,8 @@ This module contains Google PubSub operators.
|
|
25
25
|
|
26
26
|
from __future__ import annotations
|
27
27
|
|
28
|
-
from collections.abc import Sequence
|
29
|
-
from typing import TYPE_CHECKING, Any
|
28
|
+
from collections.abc import Callable, Sequence
|
29
|
+
from typing import TYPE_CHECKING, Any
|
30
30
|
|
31
31
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
32
32
|
from google.cloud.pubsub_v1.types import (
|
@@ -40,6 +40,7 @@ from google.cloud.pubsub_v1.types import (
|
|
40
40
|
SchemaSettings,
|
41
41
|
)
|
42
42
|
|
43
|
+
from airflow.configuration import conf
|
43
44
|
from airflow.exceptions import AirflowException
|
44
45
|
from airflow.providers.google.cloud.hooks.pubsub import PubSubHook
|
45
46
|
from airflow.providers.google.cloud.links.pubsub import PubSubSubscriptionLink, PubSubTopicLink
|
@@ -182,7 +183,6 @@ class PubSubCreateTopicOperator(GoogleCloudBaseOperator):
|
|
182
183
|
self.log.info("Created topic %s", self.topic)
|
183
184
|
PubSubTopicLink.persist(
|
184
185
|
context=context,
|
185
|
-
task_instance=self,
|
186
186
|
topic_id=self.topic,
|
187
187
|
project_id=self.project_id or hook.project_id,
|
188
188
|
)
|
@@ -391,7 +391,6 @@ class PubSubCreateSubscriptionOperator(GoogleCloudBaseOperator):
|
|
391
391
|
self.log.info("Created subscription for topic %s", self.topic)
|
392
392
|
PubSubSubscriptionLink.persist(
|
393
393
|
context=context,
|
394
|
-
task_instance=self,
|
395
394
|
subscription_id=self.subscription or result, # result returns subscription name
|
396
395
|
project_id=self.project_id or hook.project_id,
|
397
396
|
)
|
@@ -770,7 +769,7 @@ class PubSubPullOperator(GoogleCloudBaseOperator):
|
|
770
769
|
messages_callback: Callable[[list[ReceivedMessage], Context], Any] | None = None,
|
771
770
|
gcp_conn_id: str = "google_cloud_default",
|
772
771
|
impersonation_chain: str | Sequence[str] | None = None,
|
773
|
-
deferrable: bool = False,
|
772
|
+
deferrable: bool = conf.getboolean("operators", "default_deferrable", fallback=False),
|
774
773
|
poll_interval: int = 300,
|
775
774
|
**kwargs,
|
776
775
|
) -> None:
|
@@ -122,7 +122,6 @@ class SpannerDeployInstanceOperator(GoogleCloudBaseOperator):
|
|
122
122
|
)
|
123
123
|
SpannerInstanceLink.persist(
|
124
124
|
context=context,
|
125
|
-
task_instance=self,
|
126
125
|
instance_id=self.instance_id,
|
127
126
|
project_id=self.project_id or hook.project_id,
|
128
127
|
)
|
@@ -290,7 +289,6 @@ class SpannerQueryDatabaseInstanceOperator(GoogleCloudBaseOperator):
|
|
290
289
|
)
|
291
290
|
SpannerDatabaseLink.persist(
|
292
291
|
context=context,
|
293
|
-
task_instance=self,
|
294
292
|
instance_id=self.instance_id,
|
295
293
|
database_id=self.database_id,
|
296
294
|
project_id=self.project_id or hook.project_id,
|
@@ -380,7 +378,6 @@ class SpannerDeployDatabaseInstanceOperator(GoogleCloudBaseOperator):
|
|
380
378
|
)
|
381
379
|
SpannerDatabaseLink.persist(
|
382
380
|
context=context,
|
383
|
-
task_instance=self,
|
384
381
|
instance_id=self.instance_id,
|
385
382
|
database_id=self.database_id,
|
386
383
|
project_id=self.project_id or hook.project_id,
|
@@ -496,7 +493,6 @@ class SpannerUpdateDatabaseInstanceOperator(GoogleCloudBaseOperator):
|
|
496
493
|
)
|
497
494
|
SpannerDatabaseLink.persist(
|
498
495
|
context=context,
|
499
|
-
task_instance=self,
|
500
496
|
instance_id=self.instance_id,
|
501
497
|
database_id=self.database_id,
|
502
498
|
project_id=self.project_id or hook.project_id,
|
@@ -117,7 +117,6 @@ class CloudSpeechToTextRecognizeSpeechOperator(GoogleCloudBaseOperator):
|
|
117
117
|
if self.audio.uri:
|
118
118
|
FileDetailsLink.persist(
|
119
119
|
context=context,
|
120
|
-
task_instance=self,
|
121
120
|
# Slice from: "gs://{BUCKET_NAME}/{FILE_NAME}" to: "{BUCKET_NAME}/{FILE_NAME}"
|
122
121
|
uri=self.audio.uri[5:],
|
123
122
|
project_id=self.project_id or hook.project_id,
|
@@ -145,7 +145,6 @@ class StackdriverListAlertPoliciesOperator(GoogleCloudBaseOperator):
|
|
145
145
|
)
|
146
146
|
StackdriverPoliciesLink.persist(
|
147
147
|
context=context,
|
148
|
-
operator_instance=self,
|
149
148
|
project_id=self.project_id or self.hook.project_id,
|
150
149
|
)
|
151
150
|
return [AlertPolicy.to_dict(policy) for policy in result]
|
@@ -228,7 +227,6 @@ class StackdriverEnableAlertPoliciesOperator(GoogleCloudBaseOperator):
|
|
228
227
|
)
|
229
228
|
StackdriverPoliciesLink.persist(
|
230
229
|
context=context,
|
231
|
-
operator_instance=self,
|
232
230
|
project_id=self.project_id or self.hook.project_id,
|
233
231
|
)
|
234
232
|
|
@@ -311,7 +309,6 @@ class StackdriverDisableAlertPoliciesOperator(GoogleCloudBaseOperator):
|
|
311
309
|
)
|
312
310
|
StackdriverPoliciesLink.persist(
|
313
311
|
context=context,
|
314
|
-
operator_instance=self,
|
315
312
|
project_id=self.project_id or self.hook.project_id,
|
316
313
|
)
|
317
314
|
|
@@ -394,7 +391,6 @@ class StackdriverUpsertAlertOperator(GoogleCloudBaseOperator):
|
|
394
391
|
)
|
395
392
|
StackdriverPoliciesLink.persist(
|
396
393
|
context=context,
|
397
|
-
operator_instance=self,
|
398
394
|
project_id=self.project_id or self.hook.project_id,
|
399
395
|
)
|
400
396
|
|
@@ -580,7 +576,6 @@ class StackdriverListNotificationChannelsOperator(GoogleCloudBaseOperator):
|
|
580
576
|
)
|
581
577
|
StackdriverNotificationsLink.persist(
|
582
578
|
context=context,
|
583
|
-
operator_instance=self,
|
584
579
|
project_id=self.project_id or self.hook.project_id,
|
585
580
|
)
|
586
581
|
return [NotificationChannel.to_dict(channel) for channel in channels]
|
@@ -666,7 +661,6 @@ class StackdriverEnableNotificationChannelsOperator(GoogleCloudBaseOperator):
|
|
666
661
|
)
|
667
662
|
StackdriverNotificationsLink.persist(
|
668
663
|
context=context,
|
669
|
-
operator_instance=self,
|
670
664
|
project_id=self.project_id or self.hook.project_id,
|
671
665
|
)
|
672
666
|
|
@@ -751,7 +745,6 @@ class StackdriverDisableNotificationChannelsOperator(GoogleCloudBaseOperator):
|
|
751
745
|
)
|
752
746
|
StackdriverNotificationsLink.persist(
|
753
747
|
context=context,
|
754
|
-
operator_instance=self,
|
755
748
|
project_id=self.project_id or self.hook.project_id,
|
756
749
|
)
|
757
750
|
|
@@ -838,7 +831,6 @@ class StackdriverUpsertNotificationChannelOperator(GoogleCloudBaseOperator):
|
|
838
831
|
)
|
839
832
|
StackdriverNotificationsLink.persist(
|
840
833
|
context=context,
|
841
|
-
operator_instance=self,
|
842
834
|
project_id=self.project_id or self.hook.project_id,
|
843
835
|
)
|
844
836
|
|
@@ -137,7 +137,6 @@ class CloudTasksQueueCreateOperator(GoogleCloudBaseOperator):
|
|
137
137
|
metadata=self.metadata,
|
138
138
|
)
|
139
139
|
CloudTasksQueueLink.persist(
|
140
|
-
operator_instance=self,
|
141
140
|
context=context,
|
142
141
|
queue_name=queue.name,
|
143
142
|
)
|
@@ -236,7 +235,6 @@ class CloudTasksQueueUpdateOperator(GoogleCloudBaseOperator):
|
|
236
235
|
metadata=self.metadata,
|
237
236
|
)
|
238
237
|
CloudTasksQueueLink.persist(
|
239
|
-
operator_instance=self,
|
240
238
|
context=context,
|
241
239
|
queue_name=queue.name,
|
242
240
|
)
|
@@ -319,7 +317,6 @@ class CloudTasksQueueGetOperator(GoogleCloudBaseOperator):
|
|
319
317
|
metadata=self.metadata,
|
320
318
|
)
|
321
319
|
CloudTasksQueueLink.persist(
|
322
|
-
operator_instance=self,
|
323
320
|
context=context,
|
324
321
|
queue_name=queue.name,
|
325
322
|
)
|
@@ -406,7 +403,6 @@ class CloudTasksQueuesListOperator(GoogleCloudBaseOperator):
|
|
406
403
|
metadata=self.metadata,
|
407
404
|
)
|
408
405
|
CloudTasksLink.persist(
|
409
|
-
operator_instance=self,
|
410
406
|
context=context,
|
411
407
|
project_id=self.project_id or hook.project_id,
|
412
408
|
)
|
@@ -564,7 +560,6 @@ class CloudTasksQueuePurgeOperator(GoogleCloudBaseOperator):
|
|
564
560
|
metadata=self.metadata,
|
565
561
|
)
|
566
562
|
CloudTasksQueueLink.persist(
|
567
|
-
operator_instance=self,
|
568
563
|
context=context,
|
569
564
|
queue_name=queue.name,
|
570
565
|
)
|
@@ -647,7 +642,6 @@ class CloudTasksQueuePauseOperator(GoogleCloudBaseOperator):
|
|
647
642
|
metadata=self.metadata,
|
648
643
|
)
|
649
644
|
CloudTasksQueueLink.persist(
|
650
|
-
operator_instance=self,
|
651
645
|
context=context,
|
652
646
|
queue_name=queue.name,
|
653
647
|
)
|
@@ -730,7 +724,6 @@ class CloudTasksQueueResumeOperator(GoogleCloudBaseOperator):
|
|
730
724
|
metadata=self.metadata,
|
731
725
|
)
|
732
726
|
CloudTasksQueueLink.persist(
|
733
|
-
operator_instance=self,
|
734
727
|
context=context,
|
735
728
|
queue_name=queue.name,
|
736
729
|
)
|
@@ -830,7 +823,6 @@ class CloudTasksTaskCreateOperator(GoogleCloudBaseOperator):
|
|
830
823
|
metadata=self.metadata,
|
831
824
|
)
|
832
825
|
CloudTasksQueueLink.persist(
|
833
|
-
operator_instance=self,
|
834
826
|
context=context,
|
835
827
|
queue_name=task.name,
|
836
828
|
)
|
@@ -923,7 +915,6 @@ class CloudTasksTaskGetOperator(GoogleCloudBaseOperator):
|
|
923
915
|
metadata=self.metadata,
|
924
916
|
)
|
925
917
|
CloudTasksQueueLink.persist(
|
926
|
-
operator_instance=self,
|
927
918
|
context=context,
|
928
919
|
queue_name=task.name,
|
929
920
|
)
|
@@ -1016,7 +1007,6 @@ class CloudTasksTasksListOperator(GoogleCloudBaseOperator):
|
|
1016
1007
|
metadata=self.metadata,
|
1017
1008
|
)
|
1018
1009
|
CloudTasksQueueLink.persist(
|
1019
|
-
operator_instance=self,
|
1020
1010
|
context=context,
|
1021
1011
|
queue_name=f"projects/{self.project_id or hook.project_id}/"
|
1022
1012
|
f"locations/{self.location}/queues/{self.queue_name}",
|
@@ -1190,7 +1180,6 @@ class CloudTasksTaskRunOperator(GoogleCloudBaseOperator):
|
|
1190
1180
|
metadata=self.metadata,
|
1191
1181
|
)
|
1192
1182
|
CloudTasksQueueLink.persist(
|
1193
|
-
operator_instance=self,
|
1194
1183
|
context=context,
|
1195
1184
|
queue_name=task.name,
|
1196
1185
|
)
|
@@ -150,7 +150,6 @@ class CloudTextToSpeechSynthesizeOperator(GoogleCloudBaseOperator):
|
|
150
150
|
)
|
151
151
|
FileDetailsLink.persist(
|
152
152
|
context=context,
|
153
|
-
task_instance=self,
|
154
153
|
uri=f"{self.target_bucket_name}/{self.target_filename}",
|
155
154
|
project_id=cloud_storage_hook.project_id,
|
156
155
|
)
|