apache-airflow-providers-google 15.1.0rc1__py3-none-any.whl → 19.3.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/3rd-party-licenses/NOTICE +2 -12
- airflow/providers/google/__init__.py +3 -3
- airflow/providers/google/ads/hooks/ads.py +39 -6
- airflow/providers/google/ads/operators/ads.py +2 -2
- airflow/providers/google/ads/transfers/ads_to_gcs.py +2 -2
- airflow/providers/google/assets/gcs.py +1 -11
- airflow/providers/google/cloud/bundles/__init__.py +16 -0
- airflow/providers/google/cloud/bundles/gcs.py +161 -0
- airflow/providers/google/cloud/hooks/alloy_db.py +1 -1
- airflow/providers/google/cloud/hooks/bigquery.py +176 -293
- airflow/providers/google/cloud/hooks/cloud_batch.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_build.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_composer.py +288 -15
- airflow/providers/google/cloud/hooks/cloud_logging.py +109 -0
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_run.py +18 -10
- airflow/providers/google/cloud/hooks/cloud_sql.py +102 -23
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +29 -7
- airflow/providers/google/cloud/hooks/compute.py +1 -1
- airflow/providers/google/cloud/hooks/compute_ssh.py +6 -2
- airflow/providers/google/cloud/hooks/datacatalog.py +10 -1
- airflow/providers/google/cloud/hooks/dataflow.py +72 -95
- airflow/providers/google/cloud/hooks/dataform.py +1 -1
- airflow/providers/google/cloud/hooks/datafusion.py +21 -19
- airflow/providers/google/cloud/hooks/dataplex.py +2 -2
- airflow/providers/google/cloud/hooks/dataprep.py +1 -1
- airflow/providers/google/cloud/hooks/dataproc.py +73 -72
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +1 -1
- airflow/providers/google/cloud/hooks/dlp.py +1 -1
- airflow/providers/google/cloud/hooks/functions.py +1 -1
- airflow/providers/google/cloud/hooks/gcs.py +112 -15
- airflow/providers/google/cloud/hooks/gdm.py +1 -1
- airflow/providers/google/cloud/hooks/gen_ai.py +196 -0
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +3 -3
- airflow/providers/google/cloud/hooks/looker.py +6 -2
- airflow/providers/google/cloud/hooks/managed_kafka.py +1 -1
- airflow/providers/google/cloud/hooks/mlengine.py +4 -3
- airflow/providers/google/cloud/hooks/pubsub.py +3 -0
- airflow/providers/google/cloud/hooks/secret_manager.py +102 -10
- airflow/providers/google/cloud/hooks/spanner.py +74 -9
- airflow/providers/google/cloud/hooks/stackdriver.py +11 -9
- airflow/providers/google/cloud/hooks/tasks.py +1 -1
- airflow/providers/google/cloud/hooks/translate.py +2 -2
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +2 -210
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +3 -3
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +28 -2
- airflow/providers/google/cloud/hooks/vertex_ai/experiment_service.py +202 -0
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +308 -8
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +79 -75
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/ray.py +223 -0
- airflow/providers/google/cloud/hooks/vision.py +3 -3
- airflow/providers/google/cloud/hooks/workflows.py +1 -1
- airflow/providers/google/cloud/links/alloy_db.py +0 -46
- airflow/providers/google/cloud/links/base.py +77 -13
- 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 -44
- 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 -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 +11 -95
- airflow/providers/google/cloud/links/datastore.py +0 -31
- airflow/providers/google/cloud/links/kubernetes_engine.py +9 -60
- 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 +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 +58 -22
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +9 -6
- 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 +102 -1
- airflow/providers/google/cloud/openlineage/mixins.py +10 -8
- airflow/providers/google/cloud/openlineage/utils.py +15 -1
- airflow/providers/google/cloud/operators/alloy_db.py +71 -56
- airflow/providers/google/cloud/operators/bigquery.py +73 -636
- airflow/providers/google/cloud/operators/bigquery_dts.py +4 -6
- airflow/providers/google/cloud/operators/bigtable.py +37 -8
- airflow/providers/google/cloud/operators/cloud_base.py +21 -1
- airflow/providers/google/cloud/operators/cloud_batch.py +3 -3
- airflow/providers/google/cloud/operators/cloud_build.py +76 -33
- airflow/providers/google/cloud/operators/cloud_composer.py +129 -41
- airflow/providers/google/cloud/operators/cloud_logging_sink.py +341 -0
- airflow/providers/google/cloud/operators/cloud_memorystore.py +69 -43
- airflow/providers/google/cloud/operators/cloud_run.py +24 -6
- airflow/providers/google/cloud/operators/cloud_sql.py +8 -17
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +93 -12
- airflow/providers/google/cloud/operators/compute.py +9 -41
- airflow/providers/google/cloud/operators/datacatalog.py +157 -21
- airflow/providers/google/cloud/operators/dataflow.py +40 -16
- airflow/providers/google/cloud/operators/dataform.py +15 -5
- airflow/providers/google/cloud/operators/datafusion.py +42 -21
- airflow/providers/google/cloud/operators/dataplex.py +194 -110
- airflow/providers/google/cloud/operators/dataprep.py +1 -5
- airflow/providers/google/cloud/operators/dataproc.py +80 -36
- airflow/providers/google/cloud/operators/dataproc_metastore.py +97 -89
- airflow/providers/google/cloud/operators/datastore.py +23 -7
- airflow/providers/google/cloud/operators/dlp.py +6 -29
- airflow/providers/google/cloud/operators/functions.py +17 -8
- airflow/providers/google/cloud/operators/gcs.py +12 -9
- airflow/providers/google/cloud/operators/gen_ai.py +389 -0
- airflow/providers/google/cloud/operators/kubernetes_engine.py +62 -100
- airflow/providers/google/cloud/operators/looker.py +2 -2
- airflow/providers/google/cloud/operators/managed_kafka.py +108 -53
- airflow/providers/google/cloud/operators/natural_language.py +1 -1
- airflow/providers/google/cloud/operators/pubsub.py +68 -15
- airflow/providers/google/cloud/operators/spanner.py +26 -13
- airflow/providers/google/cloud/operators/speech_to_text.py +2 -3
- airflow/providers/google/cloud/operators/stackdriver.py +1 -9
- airflow/providers/google/cloud/operators/tasks.py +1 -12
- airflow/providers/google/cloud/operators/text_to_speech.py +2 -3
- airflow/providers/google/cloud/operators/translate.py +41 -17
- airflow/providers/google/cloud/operators/translate_speech.py +2 -3
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +39 -19
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +30 -10
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +55 -27
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +70 -8
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +43 -9
- 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 -115
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +12 -10
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +57 -11
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +31 -8
- airflow/providers/google/cloud/operators/vertex_ai/ray.py +393 -0
- airflow/providers/google/cloud/operators/video_intelligence.py +1 -1
- airflow/providers/google/cloud/operators/vision.py +2 -2
- airflow/providers/google/cloud/operators/workflows.py +18 -15
- airflow/providers/google/cloud/secrets/secret_manager.py +3 -2
- airflow/providers/google/cloud/sensors/bigquery.py +3 -3
- airflow/providers/google/cloud/sensors/bigquery_dts.py +2 -3
- airflow/providers/google/cloud/sensors/bigtable.py +11 -4
- airflow/providers/google/cloud/sensors/cloud_composer.py +533 -30
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +2 -3
- airflow/providers/google/cloud/sensors/dataflow.py +26 -10
- airflow/providers/google/cloud/sensors/dataform.py +2 -3
- airflow/providers/google/cloud/sensors/datafusion.py +4 -5
- airflow/providers/google/cloud/sensors/dataplex.py +2 -3
- airflow/providers/google/cloud/sensors/dataprep.py +2 -2
- airflow/providers/google/cloud/sensors/dataproc.py +2 -3
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +2 -3
- airflow/providers/google/cloud/sensors/gcs.py +4 -5
- airflow/providers/google/cloud/sensors/looker.py +2 -3
- airflow/providers/google/cloud/sensors/pubsub.py +4 -5
- airflow/providers/google/cloud/sensors/tasks.py +2 -2
- airflow/providers/google/cloud/sensors/vertex_ai/feature_store.py +2 -3
- airflow/providers/google/cloud/sensors/workflows.py +2 -3
- 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 +4 -3
- airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +11 -8
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +10 -5
- 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 +3 -3
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +4 -4
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +21 -13
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +4 -3
- airflow/providers/google/cloud/transfers/gcs_to_local.py +6 -4
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +11 -5
- 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 +42 -9
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +13 -7
- airflow/providers/google/cloud/transfers/salesforce_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +14 -5
- 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 +76 -35
- airflow/providers/google/cloud/triggers/cloud_build.py +1 -1
- airflow/providers/google/cloud/triggers/cloud_composer.py +303 -47
- airflow/providers/google/cloud/triggers/cloud_run.py +3 -3
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +92 -2
- airflow/providers/google/cloud/triggers/dataflow.py +122 -0
- airflow/providers/google/cloud/triggers/datafusion.py +1 -1
- airflow/providers/google/cloud/triggers/dataplex.py +14 -2
- airflow/providers/google/cloud/triggers/dataproc.py +123 -53
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +47 -28
- airflow/providers/google/cloud/triggers/mlengine.py +1 -1
- airflow/providers/google/cloud/triggers/pubsub.py +15 -19
- airflow/providers/google/cloud/triggers/vertex_ai.py +1 -1
- airflow/providers/google/cloud/utils/bigquery_get_data.py +1 -1
- airflow/providers/google/cloud/utils/credentials_provider.py +2 -2
- airflow/providers/google/cloud/utils/field_sanitizer.py +1 -1
- airflow/providers/google/cloud/utils/field_validator.py +2 -3
- airflow/providers/google/common/auth_backend/google_openid.py +4 -4
- airflow/providers/google/common/deprecated.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +27 -9
- airflow/providers/google/common/hooks/operation_helpers.py +1 -1
- 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 +3 -4
- airflow/providers/google/firebase/hooks/firestore.py +1 -1
- airflow/providers/google/firebase/operators/firestore.py +3 -3
- airflow/providers/google/get_provider_info.py +56 -52
- airflow/providers/google/go_module_utils.py +35 -3
- airflow/providers/google/leveldb/hooks/leveldb.py +27 -2
- airflow/providers/google/leveldb/operators/leveldb.py +2 -2
- airflow/providers/google/marketing_platform/hooks/campaign_manager.py +1 -1
- 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 +5 -14
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +2 -3
- airflow/providers/google/marketing_platform/operators/campaign_manager.py +6 -6
- 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 +3 -64
- airflow/providers/google/suite/hooks/calendar.py +2 -2
- airflow/providers/google/suite/hooks/sheets.py +16 -2
- 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 +3 -3
- 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-15.1.0rc1.dist-info → apache_airflow_providers_google-19.3.0.dist-info}/METADATA +90 -46
- apache_airflow_providers_google-19.3.0.dist-info/RECORD +331 -0
- apache_airflow_providers_google-19.3.0.dist-info/licenses/NOTICE +5 -0
- airflow/providers/google/cloud/hooks/automl.py +0 -673
- 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 -1362
- airflow/providers/google/cloud/operators/life_sciences.py +0 -119
- airflow/providers/google/cloud/operators/mlengine.py +0 -112
- apache_airflow_providers_google-15.1.0rc1.dist-info/RECORD +0 -321
- {apache_airflow_providers_google-15.1.0rc1.dist-info → apache_airflow_providers_google-19.3.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-15.1.0rc1.dist-info → apache_airflow_providers_google-19.3.0.dist-info}/entry_points.txt +0 -0
- {airflow/providers/google → apache_airflow_providers_google-19.3.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -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
|
DATAFORM_BASE_LINK = "/bigquery/dataform"
|
|
31
25
|
DATAFORM_WORKFLOW_INVOCATION_LINK = (
|
|
32
26
|
DATAFORM_BASE_LINK
|
|
@@ -53,26 +47,6 @@ class DataformWorkflowInvocationLink(BaseGoogleLink):
|
|
|
53
47
|
key = "dataform_workflow_invocation_config"
|
|
54
48
|
format_str = DATAFORM_WORKFLOW_INVOCATION_LINK
|
|
55
49
|
|
|
56
|
-
@staticmethod
|
|
57
|
-
def persist(
|
|
58
|
-
operator_instance: BaseOperator,
|
|
59
|
-
context: Context,
|
|
60
|
-
project_id: str,
|
|
61
|
-
region: str,
|
|
62
|
-
repository_id: str,
|
|
63
|
-
workflow_invocation_id: str,
|
|
64
|
-
):
|
|
65
|
-
operator_instance.xcom_push(
|
|
66
|
-
context,
|
|
67
|
-
key=DataformWorkflowInvocationLink.key,
|
|
68
|
-
value={
|
|
69
|
-
"project_id": project_id,
|
|
70
|
-
"region": region,
|
|
71
|
-
"repository_id": repository_id,
|
|
72
|
-
"workflow_invocation_id": workflow_invocation_id,
|
|
73
|
-
},
|
|
74
|
-
)
|
|
75
|
-
|
|
76
50
|
|
|
77
51
|
class DataformRepositoryLink(BaseGoogleLink):
|
|
78
52
|
"""Helper class for constructing Dataflow repository link."""
|
|
@@ -81,24 +55,6 @@ class DataformRepositoryLink(BaseGoogleLink):
|
|
|
81
55
|
key = "dataform_repository"
|
|
82
56
|
format_str = DATAFORM_REPOSITORY_LINK
|
|
83
57
|
|
|
84
|
-
@staticmethod
|
|
85
|
-
def persist(
|
|
86
|
-
operator_instance: BaseOperator,
|
|
87
|
-
context: Context,
|
|
88
|
-
project_id: str,
|
|
89
|
-
region: str,
|
|
90
|
-
repository_id: str,
|
|
91
|
-
) -> None:
|
|
92
|
-
operator_instance.xcom_push(
|
|
93
|
-
context=context,
|
|
94
|
-
key=DataformRepositoryLink.key,
|
|
95
|
-
value={
|
|
96
|
-
"project_id": project_id,
|
|
97
|
-
"region": region,
|
|
98
|
-
"repository_id": repository_id,
|
|
99
|
-
},
|
|
100
|
-
)
|
|
101
|
-
|
|
102
58
|
|
|
103
59
|
class DataformWorkspaceLink(BaseGoogleLink):
|
|
104
60
|
"""Helper class for constructing Dataform workspace link."""
|
|
@@ -106,23 +62,3 @@ class DataformWorkspaceLink(BaseGoogleLink):
|
|
|
106
62
|
name = "Dataform Workspace"
|
|
107
63
|
key = "dataform_workspace"
|
|
108
64
|
format_str = DATAFORM_WORKSPACE_LINK
|
|
109
|
-
|
|
110
|
-
@staticmethod
|
|
111
|
-
def persist(
|
|
112
|
-
operator_instance: BaseOperator,
|
|
113
|
-
context: Context,
|
|
114
|
-
project_id: str,
|
|
115
|
-
region: str,
|
|
116
|
-
repository_id: str,
|
|
117
|
-
workspace_id: str,
|
|
118
|
-
) -> None:
|
|
119
|
-
operator_instance.xcom_push(
|
|
120
|
-
context=context,
|
|
121
|
-
key=DataformWorkspaceLink.key,
|
|
122
|
-
value={
|
|
123
|
-
"project_id": project_id,
|
|
124
|
-
"region": region,
|
|
125
|
-
"repository_id": repository_id,
|
|
126
|
-
"workspace_id": workspace_id,
|
|
127
|
-
},
|
|
128
|
-
)
|
|
@@ -19,21 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
from __future__ import annotations
|
|
21
21
|
|
|
22
|
-
from
|
|
23
|
-
|
|
24
|
-
from airflow.providers.google.version_compat import AIRFLOW_V_3_0_PLUS
|
|
25
|
-
|
|
26
|
-
if AIRFLOW_V_3_0_PLUS:
|
|
27
|
-
from airflow.sdk import BaseOperatorLink
|
|
28
|
-
from airflow.sdk.execution_time.xcom import XCom
|
|
29
|
-
else:
|
|
30
|
-
from airflow.models import XCom # type: ignore[no-redef]
|
|
31
|
-
from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
|
|
32
|
-
|
|
33
|
-
if TYPE_CHECKING:
|
|
34
|
-
from airflow.models import BaseOperator
|
|
35
|
-
from airflow.models.taskinstancekey import TaskInstanceKey
|
|
36
|
-
from airflow.utils.context import Context
|
|
22
|
+
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
|
37
23
|
|
|
38
24
|
BASE_LINK = "https://console.cloud.google.com/data-fusion"
|
|
39
25
|
DATAFUSION_INSTANCE_LINK = BASE_LINK + "/locations/{region}/instances/{instance_name}?project={project_id}"
|
|
@@ -41,35 +27,6 @@ DATAFUSION_PIPELINES_LINK = "{uri}/cdap/ns/{namespace}/pipelines"
|
|
|
41
27
|
DATAFUSION_PIPELINE_LINK = "{uri}/pipelines/ns/{namespace}/view/{pipeline_name}"
|
|
42
28
|
|
|
43
29
|
|
|
44
|
-
class BaseGoogleLink(BaseOperatorLink):
|
|
45
|
-
"""
|
|
46
|
-
Link for Google operators.
|
|
47
|
-
|
|
48
|
-
Prevent adding ``https://console.cloud.google.com`` in front of every link
|
|
49
|
-
where URI is used.
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
name: ClassVar[str]
|
|
53
|
-
key: ClassVar[str]
|
|
54
|
-
format_str: ClassVar[str]
|
|
55
|
-
|
|
56
|
-
def get_link(
|
|
57
|
-
self,
|
|
58
|
-
operator: BaseOperator,
|
|
59
|
-
*,
|
|
60
|
-
ti_key: TaskInstanceKey,
|
|
61
|
-
) -> str:
|
|
62
|
-
conf = XCom.get_value(key=self.key, ti_key=ti_key)
|
|
63
|
-
|
|
64
|
-
if not conf:
|
|
65
|
-
return ""
|
|
66
|
-
|
|
67
|
-
# Add a default value for the 'namespace' parameter for backward compatibility.
|
|
68
|
-
conf.setdefault("namespace", "default")
|
|
69
|
-
|
|
70
|
-
return self.format_str.format(**conf)
|
|
71
|
-
|
|
72
|
-
|
|
73
30
|
class DataFusionInstanceLink(BaseGoogleLink):
|
|
74
31
|
"""Helper class for constructing Data Fusion Instance link."""
|
|
75
32
|
|
|
@@ -77,24 +34,6 @@ class DataFusionInstanceLink(BaseGoogleLink):
|
|
|
77
34
|
key = "instance_conf"
|
|
78
35
|
format_str = DATAFUSION_INSTANCE_LINK
|
|
79
36
|
|
|
80
|
-
@staticmethod
|
|
81
|
-
def persist(
|
|
82
|
-
context: Context,
|
|
83
|
-
task_instance: BaseOperator,
|
|
84
|
-
location: str,
|
|
85
|
-
instance_name: str,
|
|
86
|
-
project_id: str,
|
|
87
|
-
):
|
|
88
|
-
task_instance.xcom_push(
|
|
89
|
-
context=context,
|
|
90
|
-
key=DataFusionInstanceLink.key,
|
|
91
|
-
value={
|
|
92
|
-
"region": location,
|
|
93
|
-
"instance_name": instance_name,
|
|
94
|
-
"project_id": project_id,
|
|
95
|
-
},
|
|
96
|
-
)
|
|
97
|
-
|
|
98
37
|
|
|
99
38
|
class DataFusionPipelineLink(BaseGoogleLink):
|
|
100
39
|
"""Helper class for constructing Data Fusion Pipeline link."""
|
|
@@ -103,24 +42,6 @@ class DataFusionPipelineLink(BaseGoogleLink):
|
|
|
103
42
|
key = "pipeline_conf"
|
|
104
43
|
format_str = DATAFUSION_PIPELINE_LINK
|
|
105
44
|
|
|
106
|
-
@staticmethod
|
|
107
|
-
def persist(
|
|
108
|
-
context: Context,
|
|
109
|
-
task_instance: BaseOperator,
|
|
110
|
-
uri: str,
|
|
111
|
-
pipeline_name: str,
|
|
112
|
-
namespace: str,
|
|
113
|
-
):
|
|
114
|
-
task_instance.xcom_push(
|
|
115
|
-
context=context,
|
|
116
|
-
key=DataFusionPipelineLink.key,
|
|
117
|
-
value={
|
|
118
|
-
"uri": uri,
|
|
119
|
-
"pipeline_name": pipeline_name,
|
|
120
|
-
"namespace": namespace,
|
|
121
|
-
},
|
|
122
|
-
)
|
|
123
|
-
|
|
124
45
|
|
|
125
46
|
class DataFusionPipelinesLink(BaseGoogleLink):
|
|
126
47
|
"""Helper class for constructing list of Data Fusion Pipelines link."""
|
|
@@ -128,19 +49,3 @@ class DataFusionPipelinesLink(BaseGoogleLink):
|
|
|
128
49
|
name = "Data Fusion Pipelines List"
|
|
129
50
|
key = "pipelines_conf"
|
|
130
51
|
format_str = DATAFUSION_PIPELINES_LINK
|
|
131
|
-
|
|
132
|
-
@staticmethod
|
|
133
|
-
def persist(
|
|
134
|
-
context: Context,
|
|
135
|
-
task_instance: BaseOperator,
|
|
136
|
-
uri: str,
|
|
137
|
-
namespace: str,
|
|
138
|
-
):
|
|
139
|
-
task_instance.xcom_push(
|
|
140
|
-
context=context,
|
|
141
|
-
key=DataFusionPipelinesLink.key,
|
|
142
|
-
value={
|
|
143
|
-
"uri": uri,
|
|
144
|
-
"namespace": namespace,
|
|
145
|
-
},
|
|
146
|
-
)
|
|
@@ -19,13 +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.utils.context import Context
|
|
28
|
-
|
|
29
24
|
DATAPLEX_BASE_LINK = "/dataplex/process/tasks"
|
|
30
25
|
DATAPLEX_TASK_LINK = DATAPLEX_BASE_LINK + "/{lake_id}.{task_id};location={region}/jobs?project={project_id}"
|
|
31
26
|
DATAPLEX_TASKS_LINK = DATAPLEX_BASE_LINK + "?project={project_id}&qLake={lake_id}.{region}"
|
|
@@ -53,22 +48,6 @@ class DataplexTaskLink(BaseGoogleLink):
|
|
|
53
48
|
key = "task_conf"
|
|
54
49
|
format_str = DATAPLEX_TASK_LINK
|
|
55
50
|
|
|
56
|
-
@staticmethod
|
|
57
|
-
def persist(
|
|
58
|
-
context: Context,
|
|
59
|
-
task_instance,
|
|
60
|
-
):
|
|
61
|
-
task_instance.xcom_push(
|
|
62
|
-
context=context,
|
|
63
|
-
key=DataplexTaskLink.key,
|
|
64
|
-
value={
|
|
65
|
-
"lake_id": task_instance.lake_id,
|
|
66
|
-
"task_id": task_instance.dataplex_task_id,
|
|
67
|
-
"region": task_instance.region,
|
|
68
|
-
"project_id": task_instance.project_id,
|
|
69
|
-
},
|
|
70
|
-
)
|
|
71
|
-
|
|
72
51
|
|
|
73
52
|
class DataplexTasksLink(BaseGoogleLink):
|
|
74
53
|
"""Helper class for constructing Dataplex Tasks link."""
|
|
@@ -77,21 +56,6 @@ class DataplexTasksLink(BaseGoogleLink):
|
|
|
77
56
|
key = "tasks_conf"
|
|
78
57
|
format_str = DATAPLEX_TASKS_LINK
|
|
79
58
|
|
|
80
|
-
@staticmethod
|
|
81
|
-
def persist(
|
|
82
|
-
context: Context,
|
|
83
|
-
task_instance,
|
|
84
|
-
):
|
|
85
|
-
task_instance.xcom_push(
|
|
86
|
-
context=context,
|
|
87
|
-
key=DataplexTasksLink.key,
|
|
88
|
-
value={
|
|
89
|
-
"project_id": task_instance.project_id,
|
|
90
|
-
"lake_id": task_instance.lake_id,
|
|
91
|
-
"region": task_instance.region,
|
|
92
|
-
},
|
|
93
|
-
)
|
|
94
|
-
|
|
95
59
|
|
|
96
60
|
class DataplexLakeLink(BaseGoogleLink):
|
|
97
61
|
"""Helper class for constructing Dataplex Lake link."""
|
|
@@ -100,21 +64,6 @@ class DataplexLakeLink(BaseGoogleLink):
|
|
|
100
64
|
key = "dataplex_lake_key"
|
|
101
65
|
format_str = DATAPLEX_LAKE_LINK
|
|
102
66
|
|
|
103
|
-
@staticmethod
|
|
104
|
-
def persist(
|
|
105
|
-
context: Context,
|
|
106
|
-
task_instance,
|
|
107
|
-
):
|
|
108
|
-
task_instance.xcom_push(
|
|
109
|
-
context=context,
|
|
110
|
-
key=DataplexLakeLink.key,
|
|
111
|
-
value={
|
|
112
|
-
"lake_id": task_instance.lake_id,
|
|
113
|
-
"region": task_instance.region,
|
|
114
|
-
"project_id": task_instance.project_id,
|
|
115
|
-
},
|
|
116
|
-
)
|
|
117
|
-
|
|
118
67
|
|
|
119
68
|
class DataplexCatalogEntryGroupLink(BaseGoogleLink):
|
|
120
69
|
"""Helper class for constructing Dataplex Catalog EntryGroup link."""
|
|
@@ -123,21 +72,6 @@ class DataplexCatalogEntryGroupLink(BaseGoogleLink):
|
|
|
123
72
|
key = "dataplex_catalog_entry_group_key"
|
|
124
73
|
format_str = DATAPLEX_CATALOG_ENTRY_GROUP_LINK
|
|
125
74
|
|
|
126
|
-
@staticmethod
|
|
127
|
-
def persist(
|
|
128
|
-
context: Context,
|
|
129
|
-
task_instance,
|
|
130
|
-
):
|
|
131
|
-
task_instance.xcom_push(
|
|
132
|
-
context=context,
|
|
133
|
-
key=DataplexCatalogEntryGroupLink.key,
|
|
134
|
-
value={
|
|
135
|
-
"entry_group_id": task_instance.entry_group_id,
|
|
136
|
-
"location": task_instance.location,
|
|
137
|
-
"project_id": task_instance.project_id,
|
|
138
|
-
},
|
|
139
|
-
)
|
|
140
|
-
|
|
141
75
|
|
|
142
76
|
class DataplexCatalogEntryGroupsLink(BaseGoogleLink):
|
|
143
77
|
"""Helper class for constructing Dataplex Catalog EntryGroups link."""
|
|
@@ -146,20 +80,6 @@ class DataplexCatalogEntryGroupsLink(BaseGoogleLink):
|
|
|
146
80
|
key = "dataplex_catalog_entry_groups_key"
|
|
147
81
|
format_str = DATAPLEX_CATALOG_ENTRY_GROUPS_LINK
|
|
148
82
|
|
|
149
|
-
@staticmethod
|
|
150
|
-
def persist(
|
|
151
|
-
context: Context,
|
|
152
|
-
task_instance,
|
|
153
|
-
):
|
|
154
|
-
task_instance.xcom_push(
|
|
155
|
-
context=context,
|
|
156
|
-
key=DataplexCatalogEntryGroupsLink.key,
|
|
157
|
-
value={
|
|
158
|
-
"location": task_instance.location,
|
|
159
|
-
"project_id": task_instance.project_id,
|
|
160
|
-
},
|
|
161
|
-
)
|
|
162
|
-
|
|
163
83
|
|
|
164
84
|
class DataplexCatalogEntryTypeLink(BaseGoogleLink):
|
|
165
85
|
"""Helper class for constructing Dataplex Catalog EntryType link."""
|
|
@@ -168,21 +88,6 @@ class DataplexCatalogEntryTypeLink(BaseGoogleLink):
|
|
|
168
88
|
key = "dataplex_catalog_entry_type_key"
|
|
169
89
|
format_str = DATAPLEX_CATALOG_ENTRY_TYPE_LINK
|
|
170
90
|
|
|
171
|
-
@staticmethod
|
|
172
|
-
def persist(
|
|
173
|
-
context: Context,
|
|
174
|
-
task_instance,
|
|
175
|
-
):
|
|
176
|
-
task_instance.xcom_push(
|
|
177
|
-
context=context,
|
|
178
|
-
key=DataplexCatalogEntryTypeLink.key,
|
|
179
|
-
value={
|
|
180
|
-
"entry_type_id": task_instance.entry_type_id,
|
|
181
|
-
"location": task_instance.location,
|
|
182
|
-
"project_id": task_instance.project_id,
|
|
183
|
-
},
|
|
184
|
-
)
|
|
185
|
-
|
|
186
91
|
|
|
187
92
|
class DataplexCatalogEntryTypesLink(BaseGoogleLink):
|
|
188
93
|
"""Helper class for constructing Dataplex Catalog EntryTypes link."""
|
|
@@ -191,20 +96,6 @@ class DataplexCatalogEntryTypesLink(BaseGoogleLink):
|
|
|
191
96
|
key = "dataplex_catalog_entry_types_key"
|
|
192
97
|
format_str = DATAPLEX_CATALOG_ENTRY_TYPES_LINK
|
|
193
98
|
|
|
194
|
-
@staticmethod
|
|
195
|
-
def persist(
|
|
196
|
-
context: Context,
|
|
197
|
-
task_instance,
|
|
198
|
-
):
|
|
199
|
-
task_instance.xcom_push(
|
|
200
|
-
context=context,
|
|
201
|
-
key=DataplexCatalogEntryTypesLink.key,
|
|
202
|
-
value={
|
|
203
|
-
"location": task_instance.location,
|
|
204
|
-
"project_id": task_instance.project_id,
|
|
205
|
-
},
|
|
206
|
-
)
|
|
207
|
-
|
|
208
99
|
|
|
209
100
|
class DataplexCatalogAspectTypeLink(BaseGoogleLink):
|
|
210
101
|
"""Helper class for constructing Dataplex Catalog AspectType link."""
|
|
@@ -213,21 +104,6 @@ class DataplexCatalogAspectTypeLink(BaseGoogleLink):
|
|
|
213
104
|
key = "dataplex_catalog_aspect_type_key"
|
|
214
105
|
format_str = DATAPLEX_CATALOG_ASPECT_TYPE_LINK
|
|
215
106
|
|
|
216
|
-
@staticmethod
|
|
217
|
-
def persist(
|
|
218
|
-
context: Context,
|
|
219
|
-
task_instance,
|
|
220
|
-
):
|
|
221
|
-
task_instance.xcom_push(
|
|
222
|
-
context=context,
|
|
223
|
-
key=DataplexCatalogAspectTypeLink.key,
|
|
224
|
-
value={
|
|
225
|
-
"aspect_type_id": task_instance.aspect_type_id,
|
|
226
|
-
"location": task_instance.location,
|
|
227
|
-
"project_id": task_instance.project_id,
|
|
228
|
-
},
|
|
229
|
-
)
|
|
230
|
-
|
|
231
107
|
|
|
232
108
|
class DataplexCatalogAspectTypesLink(BaseGoogleLink):
|
|
233
109
|
"""Helper class for constructing Dataplex Catalog AspectTypes link."""
|
|
@@ -236,20 +112,6 @@ class DataplexCatalogAspectTypesLink(BaseGoogleLink):
|
|
|
236
112
|
key = "dataplex_catalog_aspect_types_key"
|
|
237
113
|
format_str = DATAPLEX_CATALOG_ASPECT_TYPES_LINK
|
|
238
114
|
|
|
239
|
-
@staticmethod
|
|
240
|
-
def persist(
|
|
241
|
-
context: Context,
|
|
242
|
-
task_instance,
|
|
243
|
-
):
|
|
244
|
-
task_instance.xcom_push(
|
|
245
|
-
context=context,
|
|
246
|
-
key=DataplexCatalogAspectTypesLink.key,
|
|
247
|
-
value={
|
|
248
|
-
"location": task_instance.location,
|
|
249
|
-
"project_id": task_instance.project_id,
|
|
250
|
-
},
|
|
251
|
-
)
|
|
252
|
-
|
|
253
115
|
|
|
254
116
|
class DataplexCatalogEntryLink(BaseGoogleLink):
|
|
255
117
|
"""Helper class for constructing Dataplex Catalog Entry link."""
|
|
@@ -257,19 +119,3 @@ class DataplexCatalogEntryLink(BaseGoogleLink):
|
|
|
257
119
|
name = "Dataplex Catalog Entry"
|
|
258
120
|
key = "dataplex_catalog_entry_key"
|
|
259
121
|
format_str = DATAPLEX_CATALOG_ENTRY_LINK
|
|
260
|
-
|
|
261
|
-
@staticmethod
|
|
262
|
-
def persist(
|
|
263
|
-
context: Context,
|
|
264
|
-
task_instance,
|
|
265
|
-
):
|
|
266
|
-
task_instance.xcom_push(
|
|
267
|
-
context=context,
|
|
268
|
-
key=DataplexCatalogEntryLink.key,
|
|
269
|
-
value={
|
|
270
|
-
"entry_id": task_instance.entry_id,
|
|
271
|
-
"entry_group_id": task_instance.entry_group_id,
|
|
272
|
-
"location": task_instance.location,
|
|
273
|
-
"project_id": task_instance.project_id,
|
|
274
|
-
},
|
|
275
|
-
)
|
|
@@ -16,13 +16,8 @@
|
|
|
16
16
|
# under the License.
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
from typing import TYPE_CHECKING
|
|
20
|
-
|
|
21
19
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
|
22
20
|
|
|
23
|
-
if TYPE_CHECKING:
|
|
24
|
-
from airflow.utils.context import Context
|
|
25
|
-
|
|
26
21
|
BASE_LINK = "https://clouddataprep.com"
|
|
27
22
|
DATAPREP_FLOW_LINK = BASE_LINK + "/flows/{flow_id}?projectId={project_id}"
|
|
28
23
|
DATAPREP_JOB_GROUP_LINK = BASE_LINK + "/jobs/{job_group_id}?projectId={project_id}"
|
|
@@ -35,14 +30,6 @@ class DataprepFlowLink(BaseGoogleLink):
|
|
|
35
30
|
key = "dataprep_flow_page"
|
|
36
31
|
format_str = DATAPREP_FLOW_LINK
|
|
37
32
|
|
|
38
|
-
@staticmethod
|
|
39
|
-
def persist(context: Context, task_instance, project_id: str, flow_id: int):
|
|
40
|
-
task_instance.xcom_push(
|
|
41
|
-
context=context,
|
|
42
|
-
key=DataprepFlowLink.key,
|
|
43
|
-
value={"project_id": project_id, "flow_id": flow_id},
|
|
44
|
-
)
|
|
45
|
-
|
|
46
33
|
|
|
47
34
|
class DataprepJobGroupLink(BaseGoogleLink):
|
|
48
35
|
"""Helper class for constructing Dataprep job group link."""
|
|
@@ -50,14 +37,3 @@ class DataprepJobGroupLink(BaseGoogleLink):
|
|
|
50
37
|
name = "Job group details page"
|
|
51
38
|
key = "dataprep_job_group_page"
|
|
52
39
|
format_str = DATAPREP_JOB_GROUP_LINK
|
|
53
|
-
|
|
54
|
-
@staticmethod
|
|
55
|
-
def persist(context: Context, task_instance, project_id: str, job_group_id: int):
|
|
56
|
-
task_instance.xcom_push(
|
|
57
|
-
context=context,
|
|
58
|
-
key=DataprepJobGroupLink.key,
|
|
59
|
-
value={
|
|
60
|
-
"project_id": project_id,
|
|
61
|
-
"job_group_id": job_group_id,
|
|
62
|
-
},
|
|
63
|
-
)
|
|
@@ -25,20 +25,13 @@ from typing import TYPE_CHECKING, Any
|
|
|
25
25
|
import attr
|
|
26
26
|
|
|
27
27
|
from airflow.exceptions import AirflowProviderDeprecationWarning
|
|
28
|
+
from airflow.providers.common.compat.sdk import BaseOperatorLink, XCom
|
|
28
29
|
from airflow.providers.google.cloud.links.base import BASE_LINK, BaseGoogleLink
|
|
29
|
-
from airflow.providers.google.version_compat import AIRFLOW_V_3_0_PLUS
|
|
30
30
|
|
|
31
31
|
if TYPE_CHECKING:
|
|
32
|
-
from airflow.models import BaseOperator
|
|
33
32
|
from airflow.models.taskinstancekey import TaskInstanceKey
|
|
34
|
-
from airflow.
|
|
35
|
-
|
|
36
|
-
if AIRFLOW_V_3_0_PLUS:
|
|
37
|
-
from airflow.sdk import BaseOperatorLink
|
|
38
|
-
from airflow.sdk.execution_time.xcom import XCom
|
|
39
|
-
else:
|
|
40
|
-
from airflow.models import XCom # type: ignore[no-redef]
|
|
41
|
-
from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
|
|
33
|
+
from airflow.providers.common.compat.sdk import Context
|
|
34
|
+
from airflow.providers.google.version_compat import BaseOperator
|
|
42
35
|
|
|
43
36
|
|
|
44
37
|
def __getattr__(name: str) -> Any:
|
|
@@ -94,16 +87,16 @@ class DataprocLink(BaseOperatorLink):
|
|
|
94
87
|
@staticmethod
|
|
95
88
|
def persist(
|
|
96
89
|
context: Context,
|
|
97
|
-
task_instance,
|
|
98
90
|
url: str,
|
|
99
91
|
resource: str,
|
|
92
|
+
region: str,
|
|
93
|
+
project_id: str,
|
|
100
94
|
):
|
|
101
|
-
task_instance.xcom_push(
|
|
102
|
-
context=context,
|
|
95
|
+
context["task_instance"].xcom_push(
|
|
103
96
|
key=DataprocLink.key,
|
|
104
97
|
value={
|
|
105
|
-
"region":
|
|
106
|
-
"project_id":
|
|
98
|
+
"region": region,
|
|
99
|
+
"project_id": project_id,
|
|
107
100
|
"url": url,
|
|
108
101
|
"resource": resource,
|
|
109
102
|
},
|
|
@@ -147,14 +140,13 @@ class DataprocListLink(BaseOperatorLink):
|
|
|
147
140
|
@staticmethod
|
|
148
141
|
def persist(
|
|
149
142
|
context: Context,
|
|
150
|
-
task_instance,
|
|
151
143
|
url: str,
|
|
144
|
+
project_id: str,
|
|
152
145
|
):
|
|
153
|
-
task_instance.xcom_push(
|
|
154
|
-
context=context,
|
|
146
|
+
context["task_instance"].xcom_push(
|
|
155
147
|
key=DataprocListLink.key,
|
|
156
148
|
value={
|
|
157
|
-
"project_id":
|
|
149
|
+
"project_id": project_id,
|
|
158
150
|
"url": url,
|
|
159
151
|
},
|
|
160
152
|
)
|
|
@@ -189,20 +181,6 @@ class DataprocClusterLink(BaseGoogleLink):
|
|
|
189
181
|
key = "dataproc_cluster"
|
|
190
182
|
format_str = DATAPROC_CLUSTER_LINK
|
|
191
183
|
|
|
192
|
-
@staticmethod
|
|
193
|
-
def persist(
|
|
194
|
-
context: Context,
|
|
195
|
-
operator: BaseOperator,
|
|
196
|
-
cluster_id: str,
|
|
197
|
-
region: str,
|
|
198
|
-
project_id: str,
|
|
199
|
-
):
|
|
200
|
-
operator.xcom_push(
|
|
201
|
-
context,
|
|
202
|
-
key=DataprocClusterLink.key,
|
|
203
|
-
value={"cluster_id": cluster_id, "region": region, "project_id": project_id},
|
|
204
|
-
)
|
|
205
|
-
|
|
206
184
|
|
|
207
185
|
class DataprocJobLink(BaseGoogleLink):
|
|
208
186
|
"""Helper class for constructing Dataproc Job Link."""
|
|
@@ -211,20 +189,6 @@ class DataprocJobLink(BaseGoogleLink):
|
|
|
211
189
|
key = "dataproc_job"
|
|
212
190
|
format_str = DATAPROC_JOB_LINK
|
|
213
191
|
|
|
214
|
-
@staticmethod
|
|
215
|
-
def persist(
|
|
216
|
-
context: Context,
|
|
217
|
-
operator: BaseOperator,
|
|
218
|
-
job_id: str,
|
|
219
|
-
region: str,
|
|
220
|
-
project_id: str,
|
|
221
|
-
):
|
|
222
|
-
operator.xcom_push(
|
|
223
|
-
context,
|
|
224
|
-
key=DataprocJobLink.key,
|
|
225
|
-
value={"job_id": job_id, "region": region, "project_id": project_id},
|
|
226
|
-
)
|
|
227
|
-
|
|
228
192
|
|
|
229
193
|
class DataprocWorkflowLink(BaseGoogleLink):
|
|
230
194
|
"""Helper class for constructing Dataproc Workflow Link."""
|
|
@@ -233,14 +197,6 @@ class DataprocWorkflowLink(BaseGoogleLink):
|
|
|
233
197
|
key = "dataproc_workflow"
|
|
234
198
|
format_str = DATAPROC_WORKFLOW_LINK
|
|
235
199
|
|
|
236
|
-
@staticmethod
|
|
237
|
-
def persist(context: Context, operator: BaseOperator, workflow_id: str, project_id: str, region: str):
|
|
238
|
-
operator.xcom_push(
|
|
239
|
-
context,
|
|
240
|
-
key=DataprocWorkflowLink.key,
|
|
241
|
-
value={"workflow_id": workflow_id, "region": region, "project_id": project_id},
|
|
242
|
-
)
|
|
243
|
-
|
|
244
200
|
|
|
245
201
|
class DataprocWorkflowTemplateLink(BaseGoogleLink):
|
|
246
202
|
"""Helper class for constructing Dataproc Workflow Template Link."""
|
|
@@ -249,20 +205,6 @@ class DataprocWorkflowTemplateLink(BaseGoogleLink):
|
|
|
249
205
|
key = "dataproc_workflow_template"
|
|
250
206
|
format_str = DATAPROC_WORKFLOW_TEMPLATE_LINK
|
|
251
207
|
|
|
252
|
-
@staticmethod
|
|
253
|
-
def persist(
|
|
254
|
-
context: Context,
|
|
255
|
-
operator: BaseOperator,
|
|
256
|
-
workflow_template_id: str,
|
|
257
|
-
project_id: str,
|
|
258
|
-
region: str,
|
|
259
|
-
):
|
|
260
|
-
operator.xcom_push(
|
|
261
|
-
context,
|
|
262
|
-
key=DataprocWorkflowTemplateLink.key,
|
|
263
|
-
value={"workflow_template_id": workflow_template_id, "region": region, "project_id": project_id},
|
|
264
|
-
)
|
|
265
|
-
|
|
266
208
|
|
|
267
209
|
class DataprocBatchLink(BaseGoogleLink):
|
|
268
210
|
"""Helper class for constructing Dataproc Batch Link."""
|
|
@@ -271,20 +213,6 @@ class DataprocBatchLink(BaseGoogleLink):
|
|
|
271
213
|
key = "dataproc_batch"
|
|
272
214
|
format_str = DATAPROC_BATCH_LINK
|
|
273
215
|
|
|
274
|
-
@staticmethod
|
|
275
|
-
def persist(
|
|
276
|
-
context: Context,
|
|
277
|
-
operator: BaseOperator,
|
|
278
|
-
batch_id: str,
|
|
279
|
-
project_id: str,
|
|
280
|
-
region: str,
|
|
281
|
-
):
|
|
282
|
-
operator.xcom_push(
|
|
283
|
-
context,
|
|
284
|
-
key=DataprocBatchLink.key,
|
|
285
|
-
value={"batch_id": batch_id, "region": region, "project_id": project_id},
|
|
286
|
-
)
|
|
287
|
-
|
|
288
216
|
|
|
289
217
|
class DataprocBatchesListLink(BaseGoogleLink):
|
|
290
218
|
"""Helper class for constructing Dataproc Batches List Link."""
|
|
@@ -292,15 +220,3 @@ class DataprocBatchesListLink(BaseGoogleLink):
|
|
|
292
220
|
name = "Dataproc Batches List"
|
|
293
221
|
key = "dataproc_batches_list"
|
|
294
222
|
format_str = DATAPROC_BATCHES_LINK
|
|
295
|
-
|
|
296
|
-
@staticmethod
|
|
297
|
-
def persist(
|
|
298
|
-
context: Context,
|
|
299
|
-
operator: BaseOperator,
|
|
300
|
-
project_id: str,
|
|
301
|
-
):
|
|
302
|
-
operator.xcom_push(
|
|
303
|
-
context,
|
|
304
|
-
key=DataprocBatchesListLink.key,
|
|
305
|
-
value={"project_id": project_id},
|
|
306
|
-
)
|