apache-airflow-providers-google 16.0.0rc1__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 +9 -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 +2 -3
- 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 +2 -2
- airflow/providers/google/cloud/hooks/looker.py +5 -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/feature_store.py +307 -7
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +43 -14
- 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 +1 -33
- 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/operators/alloy_db.py +69 -54
- airflow/providers/google/cloud/operators/automl.py +16 -14
- airflow/providers/google/cloud/operators/bigquery.py +0 -15
- 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 +0 -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 +0 -7
- airflow/providers/google/cloud/operators/kubernetes_engine.py +50 -7
- 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 +2 -4
- 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 -25
- 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 +25 -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 +1 -2
- 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 +1 -1
- 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 +1 -1
- airflow/providers/google/cloud/transfers/local_to_gcs.py +1 -1
- 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/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 +0 -11
- airflow/providers/google/leveldb/hooks/leveldb.py +5 -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.0rc1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/METADATA +27 -28
- {apache_airflow_providers_google-16.0.0rc1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/RECORD +166 -166
- {apache_airflow_providers_google-16.0.0rc1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-16.0.0rc1.dist-info → apache_airflow_providers_google-16.1.0.dist-info}/entry_points.txt +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
|
-
)
|
@@ -26,19 +26,20 @@ import attr
|
|
26
26
|
|
27
27
|
from airflow.exceptions import AirflowProviderDeprecationWarning
|
28
28
|
from airflow.providers.google.cloud.links.base import BASE_LINK, BaseGoogleLink
|
29
|
-
from airflow.providers.google.version_compat import
|
29
|
+
from airflow.providers.google.version_compat import (
|
30
|
+
AIRFLOW_V_3_0_PLUS,
|
31
|
+
BaseOperator,
|
32
|
+
BaseOperatorLink,
|
33
|
+
)
|
30
34
|
|
31
35
|
if TYPE_CHECKING:
|
32
|
-
from airflow.models import BaseOperator
|
33
36
|
from airflow.models.taskinstancekey import TaskInstanceKey
|
34
37
|
from airflow.utils.context import Context
|
35
38
|
|
36
39
|
if AIRFLOW_V_3_0_PLUS:
|
37
|
-
from airflow.sdk import BaseOperatorLink
|
38
40
|
from airflow.sdk.execution_time.xcom import XCom
|
39
41
|
else:
|
40
|
-
from airflow.models import XCom # type: ignore[no-redef]
|
41
|
-
from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
|
42
|
+
from airflow.models.xcom import XCom # type: ignore[no-redef]
|
42
43
|
|
43
44
|
|
44
45
|
def __getattr__(name: str) -> Any:
|
@@ -94,16 +95,16 @@ class DataprocLink(BaseOperatorLink):
|
|
94
95
|
@staticmethod
|
95
96
|
def persist(
|
96
97
|
context: Context,
|
97
|
-
task_instance,
|
98
98
|
url: str,
|
99
99
|
resource: str,
|
100
|
+
region: str,
|
101
|
+
project_id: str,
|
100
102
|
):
|
101
|
-
task_instance.xcom_push(
|
102
|
-
context=context,
|
103
|
+
context["task_instance"].xcom_push(
|
103
104
|
key=DataprocLink.key,
|
104
105
|
value={
|
105
|
-
"region":
|
106
|
-
"project_id":
|
106
|
+
"region": region,
|
107
|
+
"project_id": project_id,
|
107
108
|
"url": url,
|
108
109
|
"resource": resource,
|
109
110
|
},
|
@@ -147,14 +148,13 @@ class DataprocListLink(BaseOperatorLink):
|
|
147
148
|
@staticmethod
|
148
149
|
def persist(
|
149
150
|
context: Context,
|
150
|
-
task_instance,
|
151
151
|
url: str,
|
152
|
+
project_id: str,
|
152
153
|
):
|
153
|
-
task_instance.xcom_push(
|
154
|
-
context=context,
|
154
|
+
context["task_instance"].xcom_push(
|
155
155
|
key=DataprocListLink.key,
|
156
156
|
value={
|
157
|
-
"project_id":
|
157
|
+
"project_id": project_id,
|
158
158
|
"url": url,
|
159
159
|
},
|
160
160
|
)
|
@@ -189,20 +189,6 @@ class DataprocClusterLink(BaseGoogleLink):
|
|
189
189
|
key = "dataproc_cluster"
|
190
190
|
format_str = DATAPROC_CLUSTER_LINK
|
191
191
|
|
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
192
|
|
207
193
|
class DataprocJobLink(BaseGoogleLink):
|
208
194
|
"""Helper class for constructing Dataproc Job Link."""
|
@@ -211,20 +197,6 @@ class DataprocJobLink(BaseGoogleLink):
|
|
211
197
|
key = "dataproc_job"
|
212
198
|
format_str = DATAPROC_JOB_LINK
|
213
199
|
|
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
200
|
|
229
201
|
class DataprocWorkflowLink(BaseGoogleLink):
|
230
202
|
"""Helper class for constructing Dataproc Workflow Link."""
|
@@ -233,14 +205,6 @@ class DataprocWorkflowLink(BaseGoogleLink):
|
|
233
205
|
key = "dataproc_workflow"
|
234
206
|
format_str = DATAPROC_WORKFLOW_LINK
|
235
207
|
|
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
208
|
|
245
209
|
class DataprocWorkflowTemplateLink(BaseGoogleLink):
|
246
210
|
"""Helper class for constructing Dataproc Workflow Template Link."""
|
@@ -249,20 +213,6 @@ class DataprocWorkflowTemplateLink(BaseGoogleLink):
|
|
249
213
|
key = "dataproc_workflow_template"
|
250
214
|
format_str = DATAPROC_WORKFLOW_TEMPLATE_LINK
|
251
215
|
|
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
216
|
|
267
217
|
class DataprocBatchLink(BaseGoogleLink):
|
268
218
|
"""Helper class for constructing Dataproc Batch Link."""
|
@@ -271,20 +221,6 @@ class DataprocBatchLink(BaseGoogleLink):
|
|
271
221
|
key = "dataproc_batch"
|
272
222
|
format_str = DATAPROC_BATCH_LINK
|
273
223
|
|
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
224
|
|
289
225
|
class DataprocBatchesListLink(BaseGoogleLink):
|
290
226
|
"""Helper class for constructing Dataproc Batches List Link."""
|
@@ -292,15 +228,3 @@ class DataprocBatchesListLink(BaseGoogleLink):
|
|
292
228
|
name = "Dataproc Batches List"
|
293
229
|
key = "dataproc_batches_list"
|
294
230
|
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
|
-
)
|