apache-airflow-providers-google 14.0.0__py3-none-any.whl → 19.1.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/3rd-party-licenses/LICENSES.txt +14 -0
- airflow/providers/google/3rd-party-licenses/NOTICE +5 -0
- airflow/providers/google/__init__.py +3 -3
- airflow/providers/google/_vendor/__init__.py +0 -0
- airflow/providers/google/_vendor/json_merge_patch.py +91 -0
- airflow/providers/google/ads/hooks/ads.py +52 -43
- airflow/providers/google/ads/operators/ads.py +2 -2
- airflow/providers/google/ads/transfers/ads_to_gcs.py +3 -19
- airflow/providers/google/assets/gcs.py +1 -11
- airflow/providers/google/cloud/_internal_client/secret_manager_client.py +3 -2
- airflow/providers/google/cloud/bundles/gcs.py +161 -0
- airflow/providers/google/cloud/hooks/alloy_db.py +2 -3
- airflow/providers/google/cloud/hooks/bigquery.py +195 -318
- airflow/providers/google/cloud/hooks/bigquery_dts.py +8 -8
- airflow/providers/google/cloud/hooks/bigtable.py +3 -2
- airflow/providers/google/cloud/hooks/cloud_batch.py +8 -9
- airflow/providers/google/cloud/hooks/cloud_build.py +6 -65
- airflow/providers/google/cloud/hooks/cloud_composer.py +292 -24
- airflow/providers/google/cloud/hooks/cloud_logging.py +109 -0
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +4 -3
- airflow/providers/google/cloud/hooks/cloud_run.py +20 -11
- airflow/providers/google/cloud/hooks/cloud_sql.py +136 -64
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +35 -15
- airflow/providers/google/cloud/hooks/compute.py +7 -6
- airflow/providers/google/cloud/hooks/compute_ssh.py +7 -4
- airflow/providers/google/cloud/hooks/datacatalog.py +12 -3
- airflow/providers/google/cloud/hooks/dataflow.py +87 -242
- airflow/providers/google/cloud/hooks/dataform.py +9 -14
- airflow/providers/google/cloud/hooks/datafusion.py +7 -9
- airflow/providers/google/cloud/hooks/dataplex.py +13 -12
- airflow/providers/google/cloud/hooks/dataprep.py +2 -2
- airflow/providers/google/cloud/hooks/dataproc.py +76 -74
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +4 -3
- airflow/providers/google/cloud/hooks/dlp.py +5 -4
- airflow/providers/google/cloud/hooks/gcs.py +144 -33
- airflow/providers/google/cloud/hooks/gen_ai.py +196 -0
- airflow/providers/google/cloud/hooks/kms.py +3 -2
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +22 -17
- airflow/providers/google/cloud/hooks/looker.py +6 -1
- airflow/providers/google/cloud/hooks/managed_kafka.py +227 -3
- airflow/providers/google/cloud/hooks/mlengine.py +7 -8
- airflow/providers/google/cloud/hooks/natural_language.py +3 -2
- airflow/providers/google/cloud/hooks/os_login.py +3 -2
- airflow/providers/google/cloud/hooks/pubsub.py +6 -6
- airflow/providers/google/cloud/hooks/secret_manager.py +105 -12
- airflow/providers/google/cloud/hooks/spanner.py +75 -10
- airflow/providers/google/cloud/hooks/speech_to_text.py +3 -2
- airflow/providers/google/cloud/hooks/stackdriver.py +18 -18
- airflow/providers/google/cloud/hooks/tasks.py +4 -3
- airflow/providers/google/cloud/hooks/text_to_speech.py +3 -2
- airflow/providers/google/cloud/hooks/translate.py +8 -17
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +8 -222
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +9 -15
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +33 -283
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +5 -12
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/experiment_service.py +202 -0
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +311 -10
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +79 -75
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +7 -13
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +8 -12
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/prediction_service.py +3 -2
- airflow/providers/google/cloud/hooks/vertex_ai/ray.py +223 -0
- airflow/providers/google/cloud/hooks/video_intelligence.py +3 -2
- airflow/providers/google/cloud/hooks/vision.py +7 -7
- airflow/providers/google/cloud/hooks/workflows.py +4 -3
- airflow/providers/google/cloud/links/alloy_db.py +0 -46
- airflow/providers/google/cloud/links/base.py +77 -7
- 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/{life_sciences.py → cloud_run.py} +5 -27
- airflow/providers/google/cloud/links/cloud_sql.py +0 -33
- airflow/providers/google/cloud/links/cloud_storage_transfer.py +17 -46
- airflow/providers/google/cloud/links/cloud_tasks.py +7 -26
- 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 -90
- 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 +11 -89
- airflow/providers/google/cloud/links/datastore.py +0 -31
- airflow/providers/google/cloud/links/kubernetes_engine.py +11 -61
- airflow/providers/google/cloud/links/managed_kafka.py +11 -51
- 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 +17 -187
- airflow/providers/google/cloud/links/vertex_ai.py +28 -195
- airflow/providers/google/cloud/links/workflows.py +0 -52
- airflow/providers/google/cloud/log/gcs_task_handler.py +166 -118
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +14 -9
- airflow/providers/google/cloud/openlineage/CloudStorageTransferJobFacet.json +68 -0
- airflow/providers/google/cloud/openlineage/CloudStorageTransferRunFacet.json +60 -0
- airflow/providers/google/cloud/openlineage/DataFusionRunFacet.json +32 -0
- airflow/providers/google/cloud/openlineage/facets.py +141 -40
- airflow/providers/google/cloud/openlineage/mixins.py +14 -13
- airflow/providers/google/cloud/openlineage/utils.py +19 -3
- airflow/providers/google/cloud/operators/alloy_db.py +76 -61
- airflow/providers/google/cloud/operators/bigquery.py +104 -667
- airflow/providers/google/cloud/operators/bigquery_dts.py +12 -12
- airflow/providers/google/cloud/operators/bigtable.py +38 -7
- airflow/providers/google/cloud/operators/cloud_base.py +22 -1
- airflow/providers/google/cloud/operators/cloud_batch.py +18 -18
- airflow/providers/google/cloud/operators/cloud_build.py +80 -36
- airflow/providers/google/cloud/operators/cloud_composer.py +157 -71
- airflow/providers/google/cloud/operators/cloud_logging_sink.py +341 -0
- airflow/providers/google/cloud/operators/cloud_memorystore.py +74 -46
- airflow/providers/google/cloud/operators/cloud_run.py +39 -20
- airflow/providers/google/cloud/operators/cloud_sql.py +46 -61
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +92 -14
- airflow/providers/google/cloud/operators/compute.py +18 -50
- airflow/providers/google/cloud/operators/datacatalog.py +167 -29
- airflow/providers/google/cloud/operators/dataflow.py +38 -15
- airflow/providers/google/cloud/operators/dataform.py +19 -7
- airflow/providers/google/cloud/operators/datafusion.py +43 -43
- airflow/providers/google/cloud/operators/dataplex.py +212 -126
- airflow/providers/google/cloud/operators/dataprep.py +1 -5
- airflow/providers/google/cloud/operators/dataproc.py +134 -207
- airflow/providers/google/cloud/operators/dataproc_metastore.py +102 -84
- airflow/providers/google/cloud/operators/datastore.py +22 -6
- airflow/providers/google/cloud/operators/dlp.py +24 -45
- airflow/providers/google/cloud/operators/functions.py +21 -14
- airflow/providers/google/cloud/operators/gcs.py +15 -12
- airflow/providers/google/cloud/operators/gen_ai.py +389 -0
- airflow/providers/google/cloud/operators/kubernetes_engine.py +115 -106
- airflow/providers/google/cloud/operators/looker.py +1 -1
- airflow/providers/google/cloud/operators/managed_kafka.py +362 -40
- airflow/providers/google/cloud/operators/natural_language.py +5 -3
- airflow/providers/google/cloud/operators/pubsub.py +69 -21
- airflow/providers/google/cloud/operators/spanner.py +53 -45
- airflow/providers/google/cloud/operators/speech_to_text.py +5 -4
- airflow/providers/google/cloud/operators/stackdriver.py +5 -11
- airflow/providers/google/cloud/operators/tasks.py +6 -15
- airflow/providers/google/cloud/operators/text_to_speech.py +4 -3
- airflow/providers/google/cloud/operators/translate.py +46 -20
- airflow/providers/google/cloud/operators/translate_speech.py +4 -3
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +44 -34
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +34 -12
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +62 -53
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +75 -11
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +48 -12
- airflow/providers/google/cloud/operators/vertex_ai/experiment_service.py +435 -0
- airflow/providers/google/cloud/operators/vertex_ai/feature_store.py +532 -1
- airflow/providers/google/cloud/operators/vertex_ai/generative_model.py +135 -116
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +16 -12
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +62 -14
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +35 -10
- airflow/providers/google/cloud/operators/vertex_ai/ray.py +393 -0
- airflow/providers/google/cloud/operators/video_intelligence.py +5 -3
- airflow/providers/google/cloud/operators/vision.py +7 -5
- airflow/providers/google/cloud/operators/workflows.py +24 -19
- airflow/providers/google/cloud/secrets/secret_manager.py +2 -1
- airflow/providers/google/cloud/sensors/bigquery.py +2 -2
- airflow/providers/google/cloud/sensors/bigquery_dts.py +6 -4
- airflow/providers/google/cloud/sensors/bigtable.py +14 -6
- airflow/providers/google/cloud/sensors/cloud_composer.py +535 -33
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +6 -5
- airflow/providers/google/cloud/sensors/dataflow.py +27 -10
- airflow/providers/google/cloud/sensors/dataform.py +2 -2
- airflow/providers/google/cloud/sensors/datafusion.py +4 -4
- airflow/providers/google/cloud/sensors/dataplex.py +7 -5
- airflow/providers/google/cloud/sensors/dataprep.py +2 -2
- airflow/providers/google/cloud/sensors/dataproc.py +10 -9
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +4 -3
- airflow/providers/google/cloud/sensors/gcs.py +22 -21
- airflow/providers/google/cloud/sensors/looker.py +5 -5
- airflow/providers/google/cloud/sensors/pubsub.py +20 -20
- airflow/providers/google/cloud/sensors/tasks.py +2 -2
- airflow/providers/google/cloud/sensors/vertex_ai/feature_store.py +2 -2
- airflow/providers/google/cloud/sensors/workflows.py +6 -4
- airflow/providers/google/cloud/transfers/adls_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/azure_blob_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +11 -8
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +14 -13
- airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +7 -3
- airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +12 -1
- airflow/providers/google/cloud/transfers/bigquery_to_postgres.py +24 -10
- airflow/providers/google/cloud/transfers/bigquery_to_sql.py +104 -5
- airflow/providers/google/cloud/transfers/calendar_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +18 -22
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +4 -5
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +45 -38
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/gcs_to_local.py +5 -3
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +10 -4
- airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +6 -2
- airflow/providers/google/cloud/transfers/gdrive_to_local.py +2 -2
- airflow/providers/google/cloud/transfers/http_to_gcs.py +193 -0
- airflow/providers/google/cloud/transfers/local_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/mssql_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/oracle_to_gcs.py +36 -11
- airflow/providers/google/cloud/transfers/postgres_to_gcs.py +44 -12
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +12 -6
- airflow/providers/google/cloud/transfers/salesforce_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +36 -14
- airflow/providers/google/cloud/transfers/sheets_to_gcs.py +3 -3
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +10 -10
- airflow/providers/google/cloud/triggers/bigquery.py +75 -34
- airflow/providers/google/cloud/triggers/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_batch.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_build.py +3 -2
- airflow/providers/google/cloud/triggers/cloud_composer.py +303 -47
- airflow/providers/google/cloud/triggers/cloud_run.py +2 -2
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +96 -5
- airflow/providers/google/cloud/triggers/dataflow.py +125 -2
- airflow/providers/google/cloud/triggers/datafusion.py +1 -1
- airflow/providers/google/cloud/triggers/dataplex.py +16 -3
- airflow/providers/google/cloud/triggers/dataproc.py +124 -53
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +46 -28
- airflow/providers/google/cloud/triggers/mlengine.py +1 -1
- airflow/providers/google/cloud/triggers/pubsub.py +17 -20
- airflow/providers/google/cloud/triggers/vertex_ai.py +8 -7
- airflow/providers/google/cloud/utils/bigquery.py +5 -7
- airflow/providers/google/cloud/utils/bigquery_get_data.py +1 -1
- airflow/providers/google/cloud/utils/credentials_provider.py +4 -3
- airflow/providers/google/cloud/utils/dataform.py +1 -1
- airflow/providers/google/cloud/utils/external_token_supplier.py +0 -1
- airflow/providers/google/cloud/utils/field_validator.py +1 -2
- airflow/providers/google/cloud/utils/validators.py +43 -0
- airflow/providers/google/common/auth_backend/google_openid.py +26 -9
- airflow/providers/google/common/consts.py +2 -1
- airflow/providers/google/common/deprecated.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +40 -43
- airflow/providers/google/common/hooks/operation_helpers.py +78 -0
- airflow/providers/google/common/links/storage.py +0 -22
- airflow/providers/google/common/utils/get_secret.py +31 -0
- airflow/providers/google/common/utils/id_token_credentials.py +4 -5
- airflow/providers/google/firebase/operators/firestore.py +2 -2
- airflow/providers/google/get_provider_info.py +61 -216
- airflow/providers/google/go_module_utils.py +35 -3
- airflow/providers/google/leveldb/hooks/leveldb.py +30 -6
- airflow/providers/google/leveldb/operators/leveldb.py +2 -2
- airflow/providers/google/marketing_platform/hooks/analytics_admin.py +3 -2
- airflow/providers/google/marketing_platform/hooks/display_video.py +3 -109
- airflow/providers/google/marketing_platform/hooks/search_ads.py +1 -1
- airflow/providers/google/marketing_platform/links/analytics_admin.py +4 -5
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +7 -6
- airflow/providers/google/marketing_platform/operators/campaign_manager.py +5 -5
- airflow/providers/google/marketing_platform/operators/display_video.py +28 -489
- airflow/providers/google/marketing_platform/operators/search_ads.py +2 -2
- airflow/providers/google/marketing_platform/sensors/campaign_manager.py +2 -2
- airflow/providers/google/marketing_platform/sensors/display_video.py +4 -64
- airflow/providers/google/suite/hooks/calendar.py +1 -1
- airflow/providers/google/suite/hooks/drive.py +2 -2
- airflow/providers/google/suite/hooks/sheets.py +15 -1
- airflow/providers/google/suite/operators/sheets.py +8 -3
- airflow/providers/google/suite/sensors/drive.py +2 -2
- airflow/providers/google/suite/transfers/gcs_to_gdrive.py +2 -2
- airflow/providers/google/suite/transfers/gcs_to_sheets.py +1 -1
- airflow/providers/google/suite/transfers/local_to_drive.py +3 -3
- airflow/providers/google/suite/transfers/sql_to_sheets.py +5 -4
- airflow/providers/google/version_compat.py +15 -1
- {apache_airflow_providers_google-14.0.0.dist-info → apache_airflow_providers_google-19.1.0rc1.dist-info}/METADATA +117 -72
- apache_airflow_providers_google-19.1.0rc1.dist-info/RECORD +331 -0
- {apache_airflow_providers_google-14.0.0.dist-info → apache_airflow_providers_google-19.1.0rc1.dist-info}/WHEEL +1 -1
- apache_airflow_providers_google-19.1.0rc1.dist-info/licenses/NOTICE +5 -0
- airflow/providers/google/cloud/example_dags/example_cloud_task.py +0 -54
- airflow/providers/google/cloud/hooks/automl.py +0 -679
- airflow/providers/google/cloud/hooks/life_sciences.py +0 -159
- airflow/providers/google/cloud/links/automl.py +0 -193
- airflow/providers/google/cloud/operators/automl.py +0 -1360
- airflow/providers/google/cloud/operators/life_sciences.py +0 -119
- airflow/providers/google/cloud/operators/mlengine.py +0 -1515
- airflow/providers/google/cloud/utils/mlengine_operator_utils.py +0 -273
- apache_airflow_providers_google-14.0.0.dist-info/RECORD +0 -318
- /airflow/providers/google/cloud/{example_dags → bundles}/__init__.py +0 -0
- {apache_airflow_providers_google-14.0.0.dist-info → apache_airflow_providers_google-19.1.0rc1.dist-info}/entry_points.txt +0 -0
- {airflow/providers/google → apache_airflow_providers_google-19.1.0rc1.dist-info/licenses}/LICENSE +0 -0
|
@@ -23,7 +23,7 @@ from typing import TYPE_CHECKING
|
|
|
23
23
|
from airflow.providers.google.cloud.links.base import BASE_LINK, BaseGoogleLink
|
|
24
24
|
|
|
25
25
|
if TYPE_CHECKING:
|
|
26
|
-
from airflow.
|
|
26
|
+
from airflow.providers.common.compat.sdk import Context
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
TRANSLATION_BASE_LINK = BASE_LINK + "/translation"
|
|
@@ -70,19 +70,6 @@ class TranslationLegacyDatasetLink(BaseGoogleLink):
|
|
|
70
70
|
key = "translation_legacy_dataset"
|
|
71
71
|
format_str = TRANSLATION_LEGACY_DATASET_LINK
|
|
72
72
|
|
|
73
|
-
@staticmethod
|
|
74
|
-
def persist(
|
|
75
|
-
context: Context,
|
|
76
|
-
task_instance,
|
|
77
|
-
dataset_id: str,
|
|
78
|
-
project_id: str,
|
|
79
|
-
):
|
|
80
|
-
task_instance.xcom_push(
|
|
81
|
-
context,
|
|
82
|
-
key=TranslationLegacyDatasetLink.key,
|
|
83
|
-
value={"location": task_instance.location, "dataset_id": dataset_id, "project_id": project_id},
|
|
84
|
-
)
|
|
85
|
-
|
|
86
73
|
|
|
87
74
|
class TranslationDatasetListLink(BaseGoogleLink):
|
|
88
75
|
"""Helper class for constructing Translation Dataset List link."""
|
|
@@ -91,20 +78,6 @@ class TranslationDatasetListLink(BaseGoogleLink):
|
|
|
91
78
|
key = "translation_dataset_list"
|
|
92
79
|
format_str = TRANSLATION_DATASET_LIST_LINK
|
|
93
80
|
|
|
94
|
-
@staticmethod
|
|
95
|
-
def persist(
|
|
96
|
-
context: Context,
|
|
97
|
-
task_instance,
|
|
98
|
-
project_id: str,
|
|
99
|
-
):
|
|
100
|
-
task_instance.xcom_push(
|
|
101
|
-
context,
|
|
102
|
-
key=TranslationDatasetListLink.key,
|
|
103
|
-
value={
|
|
104
|
-
"project_id": project_id,
|
|
105
|
-
},
|
|
106
|
-
)
|
|
107
|
-
|
|
108
81
|
|
|
109
82
|
class TranslationLegacyModelLink(BaseGoogleLink):
|
|
110
83
|
"""
|
|
@@ -117,25 +90,6 @@ class TranslationLegacyModelLink(BaseGoogleLink):
|
|
|
117
90
|
key = "translation_legacy_model"
|
|
118
91
|
format_str = TRANSLATION_LEGACY_MODEL_LINK
|
|
119
92
|
|
|
120
|
-
@staticmethod
|
|
121
|
-
def persist(
|
|
122
|
-
context: Context,
|
|
123
|
-
task_instance,
|
|
124
|
-
dataset_id: str,
|
|
125
|
-
model_id: str,
|
|
126
|
-
project_id: str,
|
|
127
|
-
):
|
|
128
|
-
task_instance.xcom_push(
|
|
129
|
-
context,
|
|
130
|
-
key=TranslationLegacyModelLink.key,
|
|
131
|
-
value={
|
|
132
|
-
"location": task_instance.location,
|
|
133
|
-
"dataset_id": dataset_id,
|
|
134
|
-
"model_id": model_id,
|
|
135
|
-
"project_id": project_id,
|
|
136
|
-
},
|
|
137
|
-
)
|
|
138
|
-
|
|
139
93
|
|
|
140
94
|
class TranslationLegacyModelTrainLink(BaseGoogleLink):
|
|
141
95
|
"""
|
|
@@ -148,22 +102,6 @@ class TranslationLegacyModelTrainLink(BaseGoogleLink):
|
|
|
148
102
|
key = "translation_legacy_model_train"
|
|
149
103
|
format_str = TRANSLATION_LEGACY_MODEL_TRAIN_LINK
|
|
150
104
|
|
|
151
|
-
@staticmethod
|
|
152
|
-
def persist(
|
|
153
|
-
context: Context,
|
|
154
|
-
task_instance,
|
|
155
|
-
project_id: str,
|
|
156
|
-
):
|
|
157
|
-
task_instance.xcom_push(
|
|
158
|
-
context,
|
|
159
|
-
key=TranslationLegacyModelTrainLink.key,
|
|
160
|
-
value={
|
|
161
|
-
"location": task_instance.location,
|
|
162
|
-
"dataset_id": task_instance.model["dataset_id"],
|
|
163
|
-
"project_id": project_id,
|
|
164
|
-
},
|
|
165
|
-
)
|
|
166
|
-
|
|
167
105
|
|
|
168
106
|
class TranslationLegacyModelPredictLink(BaseGoogleLink):
|
|
169
107
|
"""
|
|
@@ -176,25 +114,6 @@ class TranslationLegacyModelPredictLink(BaseGoogleLink):
|
|
|
176
114
|
key = "translation_legacy_model_predict"
|
|
177
115
|
format_str = TRANSLATION_LEGACY_MODEL_PREDICT_LINK
|
|
178
116
|
|
|
179
|
-
@staticmethod
|
|
180
|
-
def persist(
|
|
181
|
-
context: Context,
|
|
182
|
-
task_instance,
|
|
183
|
-
model_id: str,
|
|
184
|
-
project_id: str,
|
|
185
|
-
dataset_id: str,
|
|
186
|
-
):
|
|
187
|
-
task_instance.xcom_push(
|
|
188
|
-
context,
|
|
189
|
-
key=TranslationLegacyModelPredictLink.key,
|
|
190
|
-
value={
|
|
191
|
-
"location": task_instance.location,
|
|
192
|
-
"dataset_id": dataset_id,
|
|
193
|
-
"model_id": model_id,
|
|
194
|
-
"project_id": project_id,
|
|
195
|
-
},
|
|
196
|
-
)
|
|
197
|
-
|
|
198
117
|
|
|
199
118
|
class TranslateTextBatchLink(BaseGoogleLink):
|
|
200
119
|
"""
|
|
@@ -212,20 +131,13 @@ class TranslateTextBatchLink(BaseGoogleLink):
|
|
|
212
131
|
def extract_output_uri_prefix(output_config):
|
|
213
132
|
return output_config["gcs_destination"]["output_uri_prefix"].rpartition("gs://")[-1]
|
|
214
133
|
|
|
215
|
-
@
|
|
216
|
-
def persist(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
task_instance.xcom_push(
|
|
223
|
-
context,
|
|
224
|
-
key=TranslateTextBatchLink.key,
|
|
225
|
-
value={
|
|
226
|
-
"project_id": project_id,
|
|
227
|
-
"output_uri_prefix": TranslateTextBatchLink.extract_output_uri_prefix(output_config),
|
|
228
|
-
},
|
|
134
|
+
@classmethod
|
|
135
|
+
def persist(cls, context: Context, **value):
|
|
136
|
+
output_config = value.get("output_config")
|
|
137
|
+
super().persist(
|
|
138
|
+
context=context,
|
|
139
|
+
project_id=value.get("project_id"),
|
|
140
|
+
output_uri_prefix=cls.extract_output_uri_prefix(output_config),
|
|
229
141
|
)
|
|
230
142
|
|
|
231
143
|
|
|
@@ -237,22 +149,9 @@ class TranslationNativeDatasetLink(BaseGoogleLink):
|
|
|
237
149
|
"""
|
|
238
150
|
|
|
239
151
|
name = "Translation Native Dataset"
|
|
240
|
-
key = "
|
|
152
|
+
key = "translation_native_dataset"
|
|
241
153
|
format_str = TRANSLATION_NATIVE_DATASET_LINK
|
|
242
154
|
|
|
243
|
-
@staticmethod
|
|
244
|
-
def persist(
|
|
245
|
-
context: Context,
|
|
246
|
-
task_instance,
|
|
247
|
-
dataset_id: str,
|
|
248
|
-
project_id: str,
|
|
249
|
-
):
|
|
250
|
-
task_instance.xcom_push(
|
|
251
|
-
context,
|
|
252
|
-
key=TranslationNativeDatasetLink.key,
|
|
253
|
-
value={"location": task_instance.location, "dataset_id": dataset_id, "project_id": project_id},
|
|
254
|
-
)
|
|
255
|
-
|
|
256
155
|
|
|
257
156
|
class TranslationDatasetsListLink(BaseGoogleLink):
|
|
258
157
|
"""
|
|
@@ -265,20 +164,6 @@ class TranslationDatasetsListLink(BaseGoogleLink):
|
|
|
265
164
|
key = "translation_dataset_list"
|
|
266
165
|
format_str = TRANSLATION_DATASET_LIST_LINK
|
|
267
166
|
|
|
268
|
-
@staticmethod
|
|
269
|
-
def persist(
|
|
270
|
-
context: Context,
|
|
271
|
-
task_instance,
|
|
272
|
-
project_id: str,
|
|
273
|
-
):
|
|
274
|
-
task_instance.xcom_push(
|
|
275
|
-
context,
|
|
276
|
-
key=TranslationDatasetsListLink.key,
|
|
277
|
-
value={
|
|
278
|
-
"project_id": project_id,
|
|
279
|
-
},
|
|
280
|
-
)
|
|
281
|
-
|
|
282
167
|
|
|
283
168
|
class TranslationModelLink(BaseGoogleLink):
|
|
284
169
|
"""
|
|
@@ -291,25 +176,6 @@ class TranslationModelLink(BaseGoogleLink):
|
|
|
291
176
|
key = "translation_model"
|
|
292
177
|
format_str = TRANSLATION_NATIVE_MODEL_LINK
|
|
293
178
|
|
|
294
|
-
@staticmethod
|
|
295
|
-
def persist(
|
|
296
|
-
context: Context,
|
|
297
|
-
task_instance,
|
|
298
|
-
dataset_id: str,
|
|
299
|
-
model_id: str,
|
|
300
|
-
project_id: str,
|
|
301
|
-
):
|
|
302
|
-
task_instance.xcom_push(
|
|
303
|
-
context,
|
|
304
|
-
key=TranslationLegacyModelLink.key,
|
|
305
|
-
value={
|
|
306
|
-
"location": task_instance.location,
|
|
307
|
-
"dataset_id": dataset_id,
|
|
308
|
-
"model_id": model_id,
|
|
309
|
-
"project_id": project_id,
|
|
310
|
-
},
|
|
311
|
-
)
|
|
312
|
-
|
|
313
179
|
|
|
314
180
|
class TranslationModelsListLink(BaseGoogleLink):
|
|
315
181
|
"""
|
|
@@ -322,20 +188,6 @@ class TranslationModelsListLink(BaseGoogleLink):
|
|
|
322
188
|
key = "translation_models_list"
|
|
323
189
|
format_str = TRANSLATION_MODELS_LIST_LINK
|
|
324
190
|
|
|
325
|
-
@staticmethod
|
|
326
|
-
def persist(
|
|
327
|
-
context: Context,
|
|
328
|
-
task_instance,
|
|
329
|
-
project_id: str,
|
|
330
|
-
):
|
|
331
|
-
task_instance.xcom_push(
|
|
332
|
-
context,
|
|
333
|
-
key=TranslationModelsListLink.key,
|
|
334
|
-
value={
|
|
335
|
-
"project_id": project_id,
|
|
336
|
-
},
|
|
337
|
-
)
|
|
338
|
-
|
|
339
191
|
|
|
340
192
|
class TranslateResultByOutputConfigLink(BaseGoogleLink):
|
|
341
193
|
"""
|
|
@@ -353,22 +205,14 @@ class TranslateResultByOutputConfigLink(BaseGoogleLink):
|
|
|
353
205
|
def extract_output_uri_prefix(output_config):
|
|
354
206
|
return output_config["gcs_destination"]["output_uri_prefix"].rpartition("gs://")[-1]
|
|
355
207
|
|
|
356
|
-
@
|
|
357
|
-
def persist(
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
context,
|
|
365
|
-
key=TranslateResultByOutputConfigLink.key,
|
|
366
|
-
value={
|
|
367
|
-
"project_id": project_id,
|
|
368
|
-
"output_uri_prefix": TranslateResultByOutputConfigLink.extract_output_uri_prefix(
|
|
369
|
-
output_config
|
|
370
|
-
),
|
|
371
|
-
},
|
|
208
|
+
@classmethod
|
|
209
|
+
def persist(cls, context: Context, **value):
|
|
210
|
+
output_config = value.get("output_config")
|
|
211
|
+
output_uri_prefix = cls.extract_output_uri_prefix(output_config)
|
|
212
|
+
super().persist(
|
|
213
|
+
context=context,
|
|
214
|
+
project_id=value.get("project_id"),
|
|
215
|
+
output_uri_prefix=output_uri_prefix,
|
|
372
216
|
)
|
|
373
217
|
|
|
374
218
|
|
|
@@ -382,17 +226,3 @@ class TranslationGlossariesListLink(BaseGoogleLink):
|
|
|
382
226
|
name = "Translation Glossaries List"
|
|
383
227
|
key = "translation_glossaries_list"
|
|
384
228
|
format_str = TRANSLATION_HUB_RESOURCES_LIST_LINK
|
|
385
|
-
|
|
386
|
-
@staticmethod
|
|
387
|
-
def persist(
|
|
388
|
-
context: Context,
|
|
389
|
-
task_instance,
|
|
390
|
-
project_id: str,
|
|
391
|
-
):
|
|
392
|
-
task_instance.xcom_push(
|
|
393
|
-
context,
|
|
394
|
-
key=TranslationGlossariesListLink.key,
|
|
395
|
-
value={
|
|
396
|
-
"project_id": project_id,
|
|
397
|
-
},
|
|
398
|
-
)
|
|
@@ -21,7 +21,7 @@ from typing import TYPE_CHECKING
|
|
|
21
21
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
|
-
from airflow.
|
|
24
|
+
from airflow.providers.common.compat.sdk import Context
|
|
25
25
|
|
|
26
26
|
VERTEX_AI_BASE_LINK = "/vertex-ai"
|
|
27
27
|
VERTEX_AI_MODEL_LINK = (
|
|
@@ -54,6 +54,10 @@ VERTEX_AI_PIPELINE_JOB_LINK = (
|
|
|
54
54
|
VERTEX_AI_BASE_LINK + "/locations/{region}/pipelines/runs/{pipeline_id}?project={project_id}"
|
|
55
55
|
)
|
|
56
56
|
VERTEX_AI_PIPELINE_JOB_LIST_LINK = VERTEX_AI_BASE_LINK + "/pipelines/runs?project={project_id}"
|
|
57
|
+
VERTEX_AI_RAY_CLUSTER_LINK = (
|
|
58
|
+
VERTEX_AI_BASE_LINK + "/locations/{location}/ray-clusters/{cluster_id}?project={project_id}"
|
|
59
|
+
)
|
|
60
|
+
VERTEX_AI_RAY_CLUSTER_LIST_LINK = VERTEX_AI_BASE_LINK + "/ray?project={project_id}"
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
class VertexAIModelLink(BaseGoogleLink):
|
|
@@ -63,22 +67,6 @@ class VertexAIModelLink(BaseGoogleLink):
|
|
|
63
67
|
key = "model_conf"
|
|
64
68
|
format_str = VERTEX_AI_MODEL_LINK
|
|
65
69
|
|
|
66
|
-
@staticmethod
|
|
67
|
-
def persist(
|
|
68
|
-
context: Context,
|
|
69
|
-
task_instance,
|
|
70
|
-
model_id: str,
|
|
71
|
-
):
|
|
72
|
-
task_instance.xcom_push(
|
|
73
|
-
context=context,
|
|
74
|
-
key=VertexAIModelLink.key,
|
|
75
|
-
value={
|
|
76
|
-
"model_id": model_id,
|
|
77
|
-
"region": task_instance.region,
|
|
78
|
-
"project_id": task_instance.project_id,
|
|
79
|
-
},
|
|
80
|
-
)
|
|
81
|
-
|
|
82
70
|
|
|
83
71
|
class VertexAIModelListLink(BaseGoogleLink):
|
|
84
72
|
"""Helper class for constructing Vertex AI Models Link."""
|
|
@@ -87,19 +75,6 @@ class VertexAIModelListLink(BaseGoogleLink):
|
|
|
87
75
|
key = "models_conf"
|
|
88
76
|
format_str = VERTEX_AI_MODEL_LIST_LINK
|
|
89
77
|
|
|
90
|
-
@staticmethod
|
|
91
|
-
def persist(
|
|
92
|
-
context: Context,
|
|
93
|
-
task_instance,
|
|
94
|
-
):
|
|
95
|
-
task_instance.xcom_push(
|
|
96
|
-
context=context,
|
|
97
|
-
key=VertexAIModelListLink.key,
|
|
98
|
-
value={
|
|
99
|
-
"project_id": task_instance.project_id,
|
|
100
|
-
},
|
|
101
|
-
)
|
|
102
|
-
|
|
103
78
|
|
|
104
79
|
class VertexAIModelExportLink(BaseGoogleLink):
|
|
105
80
|
"""Helper class for constructing Vertex AI Model Export Link."""
|
|
@@ -113,19 +88,15 @@ class VertexAIModelExportLink(BaseGoogleLink):
|
|
|
113
88
|
"""Return bucket name from output configuration."""
|
|
114
89
|
return config["artifact_destination"]["output_uri_prefix"].rpartition("gs://")[-1]
|
|
115
90
|
|
|
116
|
-
@
|
|
117
|
-
def persist(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
task_instance.xcom_push(
|
|
91
|
+
@classmethod
|
|
92
|
+
def persist(cls, context: Context, **value):
|
|
93
|
+
output_config = value.get("output_config")
|
|
94
|
+
bucket_name = cls.extract_bucket_name(output_config)
|
|
95
|
+
super().persist(
|
|
122
96
|
context=context,
|
|
123
|
-
|
|
124
|
-
value
|
|
125
|
-
|
|
126
|
-
"model_id": task_instance.model_id,
|
|
127
|
-
"bucket_name": VertexAIModelExportLink.extract_bucket_name(task_instance.output_config),
|
|
128
|
-
},
|
|
97
|
+
project_id=value.get("project_id"),
|
|
98
|
+
model_id=value.get("model_id"),
|
|
99
|
+
bucket_name=bucket_name,
|
|
129
100
|
)
|
|
130
101
|
|
|
131
102
|
|
|
@@ -136,22 +107,6 @@ class VertexAITrainingLink(BaseGoogleLink):
|
|
|
136
107
|
key = "training_conf"
|
|
137
108
|
format_str = VERTEX_AI_TRAINING_LINK
|
|
138
109
|
|
|
139
|
-
@staticmethod
|
|
140
|
-
def persist(
|
|
141
|
-
context: Context,
|
|
142
|
-
task_instance,
|
|
143
|
-
training_id: str,
|
|
144
|
-
):
|
|
145
|
-
task_instance.xcom_push(
|
|
146
|
-
context=context,
|
|
147
|
-
key=VertexAITrainingLink.key,
|
|
148
|
-
value={
|
|
149
|
-
"training_id": training_id,
|
|
150
|
-
"region": task_instance.region,
|
|
151
|
-
"project_id": task_instance.project_id,
|
|
152
|
-
},
|
|
153
|
-
)
|
|
154
|
-
|
|
155
110
|
|
|
156
111
|
class VertexAITrainingPipelinesLink(BaseGoogleLink):
|
|
157
112
|
"""Helper class for constructing Vertex AI Training Pipelines link."""
|
|
@@ -160,19 +115,6 @@ class VertexAITrainingPipelinesLink(BaseGoogleLink):
|
|
|
160
115
|
key = "pipelines_conf"
|
|
161
116
|
format_str = VERTEX_AI_TRAINING_PIPELINES_LINK
|
|
162
117
|
|
|
163
|
-
@staticmethod
|
|
164
|
-
def persist(
|
|
165
|
-
context: Context,
|
|
166
|
-
task_instance,
|
|
167
|
-
):
|
|
168
|
-
task_instance.xcom_push(
|
|
169
|
-
context=context,
|
|
170
|
-
key=VertexAITrainingPipelinesLink.key,
|
|
171
|
-
value={
|
|
172
|
-
"project_id": task_instance.project_id,
|
|
173
|
-
},
|
|
174
|
-
)
|
|
175
|
-
|
|
176
118
|
|
|
177
119
|
class VertexAIDatasetLink(BaseGoogleLink):
|
|
178
120
|
"""Helper class for constructing Vertex AI Dataset link."""
|
|
@@ -181,18 +123,6 @@ class VertexAIDatasetLink(BaseGoogleLink):
|
|
|
181
123
|
key = "dataset_conf"
|
|
182
124
|
format_str = VERTEX_AI_DATASET_LINK
|
|
183
125
|
|
|
184
|
-
@staticmethod
|
|
185
|
-
def persist(context: Context, task_instance, dataset_id: str):
|
|
186
|
-
task_instance.xcom_push(
|
|
187
|
-
context=context,
|
|
188
|
-
key=VertexAIDatasetLink.key,
|
|
189
|
-
value={
|
|
190
|
-
"dataset_id": dataset_id,
|
|
191
|
-
"region": task_instance.region,
|
|
192
|
-
"project_id": task_instance.project_id,
|
|
193
|
-
},
|
|
194
|
-
)
|
|
195
|
-
|
|
196
126
|
|
|
197
127
|
class VertexAIDatasetListLink(BaseGoogleLink):
|
|
198
128
|
"""Helper class for constructing Vertex AI Datasets Link."""
|
|
@@ -201,19 +131,6 @@ class VertexAIDatasetListLink(BaseGoogleLink):
|
|
|
201
131
|
key = "datasets_conf"
|
|
202
132
|
format_str = VERTEX_AI_DATASET_LIST_LINK
|
|
203
133
|
|
|
204
|
-
@staticmethod
|
|
205
|
-
def persist(
|
|
206
|
-
context: Context,
|
|
207
|
-
task_instance,
|
|
208
|
-
):
|
|
209
|
-
task_instance.xcom_push(
|
|
210
|
-
context=context,
|
|
211
|
-
key=VertexAIDatasetListLink.key,
|
|
212
|
-
value={
|
|
213
|
-
"project_id": task_instance.project_id,
|
|
214
|
-
},
|
|
215
|
-
)
|
|
216
|
-
|
|
217
134
|
|
|
218
135
|
class VertexAIHyperparameterTuningJobListLink(BaseGoogleLink):
|
|
219
136
|
"""Helper class for constructing Vertex AI HyperparameterTuningJobs Link."""
|
|
@@ -222,19 +139,6 @@ class VertexAIHyperparameterTuningJobListLink(BaseGoogleLink):
|
|
|
222
139
|
key = "hyperparameter_tuning_jobs_conf"
|
|
223
140
|
format_str = VERTEX_AI_HYPERPARAMETER_TUNING_JOB_LIST_LINK
|
|
224
141
|
|
|
225
|
-
@staticmethod
|
|
226
|
-
def persist(
|
|
227
|
-
context: Context,
|
|
228
|
-
task_instance,
|
|
229
|
-
):
|
|
230
|
-
task_instance.xcom_push(
|
|
231
|
-
context=context,
|
|
232
|
-
key=VertexAIHyperparameterTuningJobListLink.key,
|
|
233
|
-
value={
|
|
234
|
-
"project_id": task_instance.project_id,
|
|
235
|
-
},
|
|
236
|
-
)
|
|
237
|
-
|
|
238
142
|
|
|
239
143
|
class VertexAIBatchPredictionJobLink(BaseGoogleLink):
|
|
240
144
|
"""Helper class for constructing Vertex AI BatchPredictionJob link."""
|
|
@@ -243,22 +147,6 @@ class VertexAIBatchPredictionJobLink(BaseGoogleLink):
|
|
|
243
147
|
key = "batch_prediction_job_conf"
|
|
244
148
|
format_str = VERTEX_AI_BATCH_PREDICTION_JOB_LINK
|
|
245
149
|
|
|
246
|
-
@staticmethod
|
|
247
|
-
def persist(
|
|
248
|
-
context: Context,
|
|
249
|
-
task_instance,
|
|
250
|
-
batch_prediction_job_id: str,
|
|
251
|
-
):
|
|
252
|
-
task_instance.xcom_push(
|
|
253
|
-
context=context,
|
|
254
|
-
key=VertexAIBatchPredictionJobLink.key,
|
|
255
|
-
value={
|
|
256
|
-
"batch_prediction_job_id": batch_prediction_job_id,
|
|
257
|
-
"region": task_instance.region,
|
|
258
|
-
"project_id": task_instance.project_id,
|
|
259
|
-
},
|
|
260
|
-
)
|
|
261
|
-
|
|
262
150
|
|
|
263
151
|
class VertexAIBatchPredictionJobListLink(BaseGoogleLink):
|
|
264
152
|
"""Helper class for constructing Vertex AI BatchPredictionJobList link."""
|
|
@@ -267,19 +155,6 @@ class VertexAIBatchPredictionJobListLink(BaseGoogleLink):
|
|
|
267
155
|
key = "batch_prediction_jobs_conf"
|
|
268
156
|
format_str = VERTEX_AI_BATCH_PREDICTION_JOB_LIST_LINK
|
|
269
157
|
|
|
270
|
-
@staticmethod
|
|
271
|
-
def persist(
|
|
272
|
-
context: Context,
|
|
273
|
-
task_instance,
|
|
274
|
-
):
|
|
275
|
-
task_instance.xcom_push(
|
|
276
|
-
context=context,
|
|
277
|
-
key=VertexAIBatchPredictionJobListLink.key,
|
|
278
|
-
value={
|
|
279
|
-
"project_id": task_instance.project_id,
|
|
280
|
-
},
|
|
281
|
-
)
|
|
282
|
-
|
|
283
158
|
|
|
284
159
|
class VertexAIEndpointLink(BaseGoogleLink):
|
|
285
160
|
"""Helper class for constructing Vertex AI Endpoint link."""
|
|
@@ -288,22 +163,6 @@ class VertexAIEndpointLink(BaseGoogleLink):
|
|
|
288
163
|
key = "endpoint_conf"
|
|
289
164
|
format_str = VERTEX_AI_ENDPOINT_LINK
|
|
290
165
|
|
|
291
|
-
@staticmethod
|
|
292
|
-
def persist(
|
|
293
|
-
context: Context,
|
|
294
|
-
task_instance,
|
|
295
|
-
endpoint_id: str,
|
|
296
|
-
):
|
|
297
|
-
task_instance.xcom_push(
|
|
298
|
-
context=context,
|
|
299
|
-
key=VertexAIEndpointLink.key,
|
|
300
|
-
value={
|
|
301
|
-
"endpoint_id": endpoint_id,
|
|
302
|
-
"region": task_instance.region,
|
|
303
|
-
"project_id": task_instance.project_id,
|
|
304
|
-
},
|
|
305
|
-
)
|
|
306
|
-
|
|
307
166
|
|
|
308
167
|
class VertexAIEndpointListLink(BaseGoogleLink):
|
|
309
168
|
"""Helper class for constructing Vertex AI EndpointList link."""
|
|
@@ -312,19 +171,6 @@ class VertexAIEndpointListLink(BaseGoogleLink):
|
|
|
312
171
|
key = "endpoints_conf"
|
|
313
172
|
format_str = VERTEX_AI_ENDPOINT_LIST_LINK
|
|
314
173
|
|
|
315
|
-
@staticmethod
|
|
316
|
-
def persist(
|
|
317
|
-
context: Context,
|
|
318
|
-
task_instance,
|
|
319
|
-
):
|
|
320
|
-
task_instance.xcom_push(
|
|
321
|
-
context=context,
|
|
322
|
-
key=VertexAIEndpointListLink.key,
|
|
323
|
-
value={
|
|
324
|
-
"project_id": task_instance.project_id,
|
|
325
|
-
},
|
|
326
|
-
)
|
|
327
|
-
|
|
328
174
|
|
|
329
175
|
class VertexAIPipelineJobLink(BaseGoogleLink):
|
|
330
176
|
"""Helper class for constructing Vertex AI PipelineJob link."""
|
|
@@ -333,22 +179,6 @@ class VertexAIPipelineJobLink(BaseGoogleLink):
|
|
|
333
179
|
key = "pipeline_job_conf"
|
|
334
180
|
format_str = VERTEX_AI_PIPELINE_JOB_LINK
|
|
335
181
|
|
|
336
|
-
@staticmethod
|
|
337
|
-
def persist(
|
|
338
|
-
context: Context,
|
|
339
|
-
task_instance,
|
|
340
|
-
pipeline_id: str,
|
|
341
|
-
):
|
|
342
|
-
task_instance.xcom_push(
|
|
343
|
-
context=context,
|
|
344
|
-
key=VertexAIPipelineJobLink.key,
|
|
345
|
-
value={
|
|
346
|
-
"pipeline_id": pipeline_id,
|
|
347
|
-
"region": task_instance.region,
|
|
348
|
-
"project_id": task_instance.project_id,
|
|
349
|
-
},
|
|
350
|
-
)
|
|
351
|
-
|
|
352
182
|
|
|
353
183
|
class VertexAIPipelineJobListLink(BaseGoogleLink):
|
|
354
184
|
"""Helper class for constructing Vertex AI PipelineJobList link."""
|
|
@@ -357,15 +187,18 @@ class VertexAIPipelineJobListLink(BaseGoogleLink):
|
|
|
357
187
|
key = "pipeline_job_list_conf"
|
|
358
188
|
format_str = VERTEX_AI_PIPELINE_JOB_LIST_LINK
|
|
359
189
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
190
|
+
|
|
191
|
+
class VertexAIRayClusterLink(BaseGoogleLink):
|
|
192
|
+
"""Helper class for constructing Vertex AI Ray Cluster link."""
|
|
193
|
+
|
|
194
|
+
name = "Ray Cluster"
|
|
195
|
+
key = "ray_cluster_conf"
|
|
196
|
+
format_str = VERTEX_AI_RAY_CLUSTER_LINK
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class VertexAIRayClusterListLink(BaseGoogleLink):
|
|
200
|
+
"""Helper class for constructing Vertex AI Ray Cluster List link."""
|
|
201
|
+
|
|
202
|
+
name = "Ray Cluster List"
|
|
203
|
+
key = "ray_cluster_list_conf"
|
|
204
|
+
format_str = VERTEX_AI_RAY_CLUSTER_LIST_LINK
|
|
@@ -19,14 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
from __future__ import annotations
|
|
21
21
|
|
|
22
|
-
from typing import TYPE_CHECKING
|
|
23
|
-
|
|
24
22
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
|
25
23
|
|
|
26
|
-
if TYPE_CHECKING:
|
|
27
|
-
from airflow.models import BaseOperator
|
|
28
|
-
from airflow.utils.context import Context
|
|
29
|
-
|
|
30
24
|
WORKFLOWS_BASE_LINK = "/workflows"
|
|
31
25
|
WORKFLOW_LINK = WORKFLOWS_BASE_LINK + "/workflow/{location_id}/{workflow_id}/executions?project={project_id}"
|
|
32
26
|
WORKFLOWS_LINK = WORKFLOWS_BASE_LINK + "?project={project_id}"
|
|
@@ -43,20 +37,6 @@ class WorkflowsWorkflowDetailsLink(BaseGoogleLink):
|
|
|
43
37
|
key = "workflow_details"
|
|
44
38
|
format_str = WORKFLOW_LINK
|
|
45
39
|
|
|
46
|
-
@staticmethod
|
|
47
|
-
def persist(
|
|
48
|
-
context: Context,
|
|
49
|
-
task_instance: BaseOperator,
|
|
50
|
-
location_id: str,
|
|
51
|
-
workflow_id: str,
|
|
52
|
-
project_id: str | None,
|
|
53
|
-
):
|
|
54
|
-
task_instance.xcom_push(
|
|
55
|
-
context,
|
|
56
|
-
key=WorkflowsWorkflowDetailsLink.key,
|
|
57
|
-
value={"location_id": location_id, "workflow_id": workflow_id, "project_id": project_id},
|
|
58
|
-
)
|
|
59
|
-
|
|
60
40
|
|
|
61
41
|
class WorkflowsListOfWorkflowsLink(BaseGoogleLink):
|
|
62
42
|
"""Helper class for constructing list of Workflows Link."""
|
|
@@ -65,18 +45,6 @@ class WorkflowsListOfWorkflowsLink(BaseGoogleLink):
|
|
|
65
45
|
key = "list_of_workflows"
|
|
66
46
|
format_str = WORKFLOWS_LINK
|
|
67
47
|
|
|
68
|
-
@staticmethod
|
|
69
|
-
def persist(
|
|
70
|
-
context: Context,
|
|
71
|
-
task_instance: BaseOperator,
|
|
72
|
-
project_id: str | None,
|
|
73
|
-
):
|
|
74
|
-
task_instance.xcom_push(
|
|
75
|
-
context,
|
|
76
|
-
key=WorkflowsListOfWorkflowsLink.key,
|
|
77
|
-
value={"project_id": project_id},
|
|
78
|
-
)
|
|
79
|
-
|
|
80
48
|
|
|
81
49
|
class WorkflowsExecutionLink(BaseGoogleLink):
|
|
82
50
|
"""Helper class for constructing Workflows Execution Link."""
|
|
@@ -84,23 +52,3 @@ class WorkflowsExecutionLink(BaseGoogleLink):
|
|
|
84
52
|
name = "Workflow Execution"
|
|
85
53
|
key = "workflow_execution"
|
|
86
54
|
format_str = EXECUTION_LINK
|
|
87
|
-
|
|
88
|
-
@staticmethod
|
|
89
|
-
def persist(
|
|
90
|
-
context: Context,
|
|
91
|
-
task_instance: BaseOperator,
|
|
92
|
-
location_id: str,
|
|
93
|
-
workflow_id: str,
|
|
94
|
-
execution_id: str,
|
|
95
|
-
project_id: str | None,
|
|
96
|
-
):
|
|
97
|
-
task_instance.xcom_push(
|
|
98
|
-
context,
|
|
99
|
-
key=WorkflowsExecutionLink.key,
|
|
100
|
-
value={
|
|
101
|
-
"location_id": location_id,
|
|
102
|
-
"workflow_id": workflow_id,
|
|
103
|
-
"execution_id": execution_id,
|
|
104
|
-
"project_id": project_id,
|
|
105
|
-
},
|
|
106
|
-
)
|