apache-airflow-providers-google 10.7.0rc1__py3-none-any.whl → 10.8.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 +10 -6
- airflow/providers/google/cloud/_internal_client/secret_manager_client.py +4 -1
- airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py +31 -34
- airflow/providers/google/cloud/hooks/automl.py +11 -9
- airflow/providers/google/cloud/hooks/bigquery.py +30 -36
- airflow/providers/google/cloud/hooks/bigquery_dts.py +5 -3
- airflow/providers/google/cloud/hooks/bigtable.py +11 -8
- airflow/providers/google/cloud/hooks/cloud_batch.py +5 -3
- airflow/providers/google/cloud/hooks/cloud_build.py +6 -4
- airflow/providers/google/cloud/hooks/cloud_composer.py +14 -10
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +5 -3
- airflow/providers/google/cloud/hooks/cloud_run.py +5 -3
- airflow/providers/google/cloud/hooks/cloud_sql.py +11 -14
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +8 -6
- airflow/providers/google/cloud/hooks/compute.py +5 -3
- airflow/providers/google/cloud/hooks/compute_ssh.py +1 -1
- airflow/providers/google/cloud/hooks/datacatalog.py +5 -3
- airflow/providers/google/cloud/hooks/dataflow.py +8 -11
- airflow/providers/google/cloud/hooks/dataform.py +4 -2
- airflow/providers/google/cloud/hooks/datafusion.py +24 -6
- airflow/providers/google/cloud/hooks/dataplex.py +75 -6
- airflow/providers/google/cloud/hooks/dataproc.py +9 -7
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +8 -6
- airflow/providers/google/cloud/hooks/dlp.py +139 -137
- airflow/providers/google/cloud/hooks/gcs.py +15 -20
- airflow/providers/google/cloud/hooks/kms.py +4 -2
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +34 -34
- airflow/providers/google/cloud/hooks/looker.py +4 -1
- airflow/providers/google/cloud/hooks/mlengine.py +8 -6
- airflow/providers/google/cloud/hooks/natural_language.py +4 -2
- airflow/providers/google/cloud/hooks/os_login.py +9 -7
- airflow/providers/google/cloud/hooks/pubsub.py +13 -11
- airflow/providers/google/cloud/hooks/spanner.py +7 -5
- airflow/providers/google/cloud/hooks/speech_to_text.py +4 -2
- airflow/providers/google/cloud/hooks/stackdriver.py +6 -5
- airflow/providers/google/cloud/hooks/tasks.py +5 -3
- airflow/providers/google/cloud/hooks/text_to_speech.py +4 -2
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +7 -5
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +6 -4
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +11 -9
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +12 -10
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +8 -6
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +6 -4
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +7 -5
- airflow/providers/google/cloud/hooks/video_intelligence.py +5 -3
- airflow/providers/google/cloud/hooks/vision.py +5 -3
- airflow/providers/google/cloud/hooks/workflows.py +8 -6
- airflow/providers/google/cloud/links/bigquery.py +1 -1
- airflow/providers/google/cloud/links/bigquery_dts.py +1 -1
- airflow/providers/google/cloud/links/cloud_functions.py +1 -1
- airflow/providers/google/cloud/links/cloud_memorystore.py +1 -1
- airflow/providers/google/cloud/links/cloud_sql.py +1 -1
- airflow/providers/google/cloud/links/cloud_tasks.py +1 -1
- airflow/providers/google/cloud/links/compute.py +1 -1
- airflow/providers/google/cloud/links/datacatalog.py +1 -1
- airflow/providers/google/cloud/links/dataflow.py +1 -1
- airflow/providers/google/cloud/links/dataform.py +1 -1
- airflow/providers/google/cloud/links/pubsub.py +1 -1
- airflow/providers/google/cloud/links/spanner.py +1 -1
- airflow/providers/google/cloud/links/stackdriver.py +1 -1
- airflow/providers/google/cloud/links/workflows.py +2 -2
- airflow/providers/google/cloud/log/gcs_task_handler.py +5 -7
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +8 -4
- airflow/providers/google/cloud/operators/automl.py +2 -1
- airflow/providers/google/cloud/operators/bigquery.py +6 -2
- airflow/providers/google/cloud/operators/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/operators/bigtable.py +5 -3
- airflow/providers/google/cloud/operators/cloud_batch.py +6 -3
- airflow/providers/google/cloud/operators/cloud_build.py +2 -1
- airflow/providers/google/cloud/operators/cloud_composer.py +3 -2
- airflow/providers/google/cloud/operators/cloud_memorystore.py +3 -2
- airflow/providers/google/cloud/operators/cloud_run.py +3 -2
- airflow/providers/google/cloud/operators/cloud_sql.py +157 -152
- airflow/providers/google/cloud/operators/compute.py +59 -61
- airflow/providers/google/cloud/operators/datacatalog.py +3 -2
- airflow/providers/google/cloud/operators/dataflow.py +3 -1
- airflow/providers/google/cloud/operators/dataform.py +2 -1
- airflow/providers/google/cloud/operators/datafusion.py +1 -1
- airflow/providers/google/cloud/operators/dataplex.py +110 -8
- airflow/providers/google/cloud/operators/dataproc.py +39 -18
- airflow/providers/google/cloud/operators/dataproc_metastore.py +2 -1
- airflow/providers/google/cloud/operators/dlp.py +3 -2
- airflow/providers/google/cloud/operators/functions.py +46 -46
- airflow/providers/google/cloud/operators/gcs.py +4 -6
- airflow/providers/google/cloud/operators/kubernetes_engine.py +2 -1
- airflow/providers/google/cloud/operators/natural_language.py +3 -2
- airflow/providers/google/cloud/operators/pubsub.py +2 -1
- airflow/providers/google/cloud/operators/speech_to_text.py +3 -2
- airflow/providers/google/cloud/operators/stackdriver.py +2 -1
- airflow/providers/google/cloud/operators/tasks.py +3 -2
- airflow/providers/google/cloud/operators/text_to_speech.py +3 -2
- airflow/providers/google/cloud/operators/translate_speech.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +3 -2
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +2 -1
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +3 -2
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +4 -4
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +3 -2
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +2 -1
- airflow/providers/google/cloud/operators/video_intelligence.py +2 -1
- airflow/providers/google/cloud/operators/vision.py +3 -2
- airflow/providers/google/cloud/operators/workflows.py +7 -5
- airflow/providers/google/cloud/secrets/secret_manager.py +2 -2
- airflow/providers/google/cloud/sensors/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/sensors/dataplex.py +2 -1
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +2 -2
- airflow/providers/google/cloud/sensors/gcs.py +2 -1
- airflow/providers/google/cloud/sensors/workflows.py +2 -1
- airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +24 -10
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +2 -1
- airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +2 -1
- airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +1 -4
- airflow/providers/google/cloud/transfers/bigquery_to_postgres.py +1 -4
- airflow/providers/google/cloud/transfers/bigquery_to_sql.py +1 -1
- airflow/providers/google/cloud/transfers/calendar_to_gcs.py +4 -2
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +1 -3
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +2 -1
- airflow/providers/google/cloud/transfers/presto_to_gcs.py +5 -4
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/trino_to_gcs.py +5 -4
- airflow/providers/google/cloud/triggers/bigquery.py +30 -36
- airflow/providers/google/cloud/triggers/bigquery_dts.py +9 -10
- airflow/providers/google/cloud/triggers/cloud_batch.py +6 -8
- airflow/providers/google/cloud/triggers/cloud_build.py +5 -6
- airflow/providers/google/cloud/triggers/cloud_run.py +4 -3
- airflow/providers/google/cloud/triggers/cloud_sql.py +10 -10
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +1 -1
- airflow/providers/google/cloud/triggers/dataflow.py +5 -6
- airflow/providers/google/cloud/triggers/datafusion.py +5 -6
- airflow/providers/google/cloud/triggers/dataplex.py +110 -0
- airflow/providers/google/cloud/triggers/dataproc.py +18 -20
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +14 -13
- airflow/providers/google/cloud/triggers/mlengine.py +5 -5
- airflow/providers/google/cloud/triggers/pubsub.py +2 -2
- airflow/providers/google/cloud/utils/bigquery_get_data.py +6 -3
- airflow/providers/google/cloud/utils/credentials_provider.py +1 -1
- airflow/providers/google/cloud/utils/field_validator.py +13 -13
- airflow/providers/google/cloud/utils/mlengine_operator_utils.py +5 -3
- airflow/providers/google/cloud/utils/mlengine_prediction_summary.py +1 -1
- airflow/providers/google/common/hooks/base_google.py +10 -2
- airflow/providers/google/common/links/storage.py +1 -1
- airflow/providers/google/common/utils/id_token_credentials.py +4 -1
- airflow/providers/google/get_provider_info.py +5 -0
- airflow/providers/google/marketing_platform/hooks/campaign_manager.py +4 -2
- airflow/providers/google/marketing_platform/sensors/display_video.py +6 -3
- airflow/providers/google/suite/hooks/calendar.py +4 -2
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/METADATA +8 -8
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/RECORD +155 -173
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/WHEEL +1 -1
- airflow/providers/google/ads/_vendor/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/interceptors/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/common/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/common/types/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/enums/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/enums/types/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/errors/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/errors/types/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/resources/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/resources/types/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/services/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/services/customer_service/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/services/customer_service/transports/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/services/google_ads_service/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/services/google_ads_service/transports/__init__.py +0 -16
- airflow/providers/google/ads/_vendor/googleads/v12/services/types/__init__.py +0 -16
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/LICENSE +0 -0
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/NOTICE +0 -0
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/entry_points.txt +0 -0
- {apache_airflow_providers_google-10.7.0rc1.dist-info → apache_airflow_providers_google-10.8.0.dist-info}/top_level.txt +0 -0
@@ -20,10 +20,9 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from copy import deepcopy
|
22
22
|
from functools import cached_property
|
23
|
-
from typing import Any, Callable, Sequence
|
23
|
+
from typing import TYPE_CHECKING, Any, Callable, Sequence
|
24
24
|
|
25
25
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
26
|
-
from google.api_core.retry import Retry
|
27
26
|
from google.cloud.vision_v1 import (
|
28
27
|
AnnotateImageRequest,
|
29
28
|
Image,
|
@@ -33,13 +32,16 @@ from google.cloud.vision_v1 import (
|
|
33
32
|
ProductSet,
|
34
33
|
ReferenceImage,
|
35
34
|
)
|
36
|
-
from google.protobuf import field_mask_pb2
|
37
35
|
from google.protobuf.json_format import MessageToDict
|
38
36
|
|
39
37
|
from airflow.exceptions import AirflowException
|
40
38
|
from airflow.providers.google.common.consts import CLIENT_INFO
|
41
39
|
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseHook
|
42
40
|
|
41
|
+
if TYPE_CHECKING:
|
42
|
+
from google.api_core.retry import Retry
|
43
|
+
from google.protobuf import field_mask_pb2
|
44
|
+
|
43
45
|
ERR_DIFF_NAMES = """The {label} name provided in the object ({explicit_name}) is different
|
44
46
|
than the name created from the input parameters ({constructed_name}). Please either:
|
45
47
|
1) Remove the {label} name,
|
@@ -16,20 +16,22 @@
|
|
16
16
|
# under the License.
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
from typing import Sequence
|
19
|
+
from typing import TYPE_CHECKING, Sequence
|
20
20
|
|
21
21
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
22
|
-
from google.api_core.operation import Operation
|
23
|
-
from google.api_core.retry import Retry
|
24
22
|
from google.cloud.workflows.executions_v1beta import Execution, ExecutionsClient
|
25
|
-
from google.cloud.workflows.executions_v1beta.services.executions.pagers import ListExecutionsPager
|
26
23
|
from google.cloud.workflows_v1beta import Workflow, WorkflowsClient
|
27
|
-
from google.cloud.workflows_v1beta.services.workflows.pagers import ListWorkflowsPager
|
28
|
-
from google.protobuf.field_mask_pb2 import FieldMask
|
29
24
|
|
30
25
|
from airflow.providers.google.common.consts import CLIENT_INFO
|
31
26
|
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseHook
|
32
27
|
|
28
|
+
if TYPE_CHECKING:
|
29
|
+
from google.api_core.operation import Operation
|
30
|
+
from google.api_core.retry import Retry
|
31
|
+
from google.cloud.workflows.executions_v1beta.services.executions.pagers import ListExecutionsPager
|
32
|
+
from google.cloud.workflows_v1beta.services.workflows.pagers import ListWorkflowsPager
|
33
|
+
from google.protobuf.field_mask_pb2 import FieldMask
|
34
|
+
|
33
35
|
|
34
36
|
class WorkflowsHook(GoogleBaseHook):
|
35
37
|
"""
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
BIGQUERY_BASE_LINK = "/bigquery"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
BIGQUERY_BASE_LINK = "/bigquery/transfers"
|
@@ -21,10 +21,10 @@ from __future__ import annotations
|
|
21
21
|
|
22
22
|
from typing import TYPE_CHECKING
|
23
23
|
|
24
|
-
from airflow.models import BaseOperator
|
25
24
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
26
25
|
|
27
26
|
if TYPE_CHECKING:
|
27
|
+
from airflow.models import BaseOperator
|
28
28
|
from airflow.utils.context import Context
|
29
29
|
|
30
30
|
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
BASE_LINK = "/memorystore"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
CLOUD_TASKS_BASE_LINK = "/cloudtasks"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
COMPUTE_BASE_LINK = "https://console.cloud.google.com/compute"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
DATACATALOG_BASE_LINK = "/datacatalog"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
DATAFLOW_BASE_LINK = "/dataflow/jobs"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
DATAFORM_BASE_LINK = "/bigquery/dataform"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
PUBSUB_BASE_LINK = "/cloudpubsub"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
SPANNER_BASE_LINK = "/spanner/instances"
|
@@ -20,10 +20,10 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
29
|
STACKDRIVER_BASE_LINK = "/monitoring/alerting"
|
@@ -20,13 +20,13 @@ from __future__ import annotations
|
|
20
20
|
|
21
21
|
from typing import TYPE_CHECKING
|
22
22
|
|
23
|
-
from airflow.models import BaseOperator
|
24
23
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
24
|
|
26
25
|
if TYPE_CHECKING:
|
26
|
+
from airflow.models import BaseOperator
|
27
27
|
from airflow.utils.context import Context
|
28
28
|
|
29
|
-
WORKFLOWS_BASE_LINK = "workflows"
|
29
|
+
WORKFLOWS_BASE_LINK = "/workflows"
|
30
30
|
WORKFLOW_LINK = WORKFLOWS_BASE_LINK + "/workflow/{location_id}/{workflow_id}/executions?project={project_id}"
|
31
31
|
WORKFLOWS_LINK = WORKFLOWS_BASE_LINK + "?project={project_id}"
|
32
32
|
EXECUTION_LINK = (
|
@@ -241,11 +241,9 @@ class GCSTaskHandler(FileTaskHandler, LoggingMixin):
|
|
241
241
|
try:
|
242
242
|
blob = storage.Blob.from_string(remote_log_location, self.client)
|
243
243
|
old_log = blob.download_as_bytes().decode()
|
244
|
-
log = "\n"
|
244
|
+
log = f"{old_log}\n{log}" if old_log else log
|
245
245
|
except Exception as e:
|
246
|
-
if self.no_log_found(e):
|
247
|
-
pass
|
248
|
-
else:
|
246
|
+
if not self.no_log_found(e):
|
249
247
|
log += self._add_message(
|
250
248
|
f"Error checking for previous log; if exists, may be overwritten: {e}"
|
251
249
|
)
|
@@ -265,8 +263,8 @@ class GCSTaskHandler(FileTaskHandler, LoggingMixin):
|
|
265
263
|
|
266
264
|
:meta private:
|
267
265
|
"""
|
268
|
-
if exc.args and isinstance(exc.args[0], str) and "No such object" in exc.args[0]
|
269
|
-
|
270
|
-
|
266
|
+
if (exc.args and isinstance(exc.args[0], str) and "No such object" in exc.args[0]) or getattr(
|
267
|
+
exc, "resp", {}
|
268
|
+
).get("status") == "404":
|
271
269
|
return True
|
272
270
|
return False
|
@@ -18,22 +18,26 @@
|
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
20
|
import logging
|
21
|
-
from contextvars import ContextVar
|
22
21
|
from functools import cached_property
|
23
|
-
from typing import Collection
|
22
|
+
from typing import TYPE_CHECKING, Collection
|
24
23
|
from urllib.parse import urlencode
|
25
24
|
|
26
|
-
from google.auth.credentials import Credentials
|
27
25
|
from google.cloud import logging as gcp_logging
|
28
26
|
from google.cloud.logging import Resource
|
29
27
|
from google.cloud.logging.handlers.transports import BackgroundThreadTransport, Transport
|
30
28
|
from google.cloud.logging_v2.services.logging_service_v2 import LoggingServiceV2Client
|
31
29
|
from google.cloud.logging_v2.types import ListLogEntriesRequest, ListLogEntriesResponse
|
32
30
|
|
33
|
-
from airflow.models import TaskInstance
|
34
31
|
from airflow.providers.google.cloud.utils.credentials_provider import get_credentials_and_project_id
|
35
32
|
from airflow.providers.google.common.consts import CLIENT_INFO
|
36
33
|
|
34
|
+
if TYPE_CHECKING:
|
35
|
+
from contextvars import ContextVar
|
36
|
+
|
37
|
+
from google.auth.credentials import Credentials
|
38
|
+
|
39
|
+
from airflow.models import TaskInstance
|
40
|
+
|
37
41
|
try:
|
38
42
|
# todo: remove this conditional import when min airflow version >= 2.6
|
39
43
|
ctx_indiv_trigger: ContextVar | None
|
@@ -22,7 +22,6 @@ import ast
|
|
22
22
|
from typing import TYPE_CHECKING, Sequence, Tuple
|
23
23
|
|
24
24
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
25
|
-
from google.api_core.retry import Retry
|
26
25
|
from google.cloud.automl_v1beta1 import (
|
27
26
|
BatchPredictResult,
|
28
27
|
ColumnSpec,
|
@@ -43,6 +42,8 @@ from airflow.providers.google.cloud.links.automl import (
|
|
43
42
|
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
44
43
|
|
45
44
|
if TYPE_CHECKING:
|
45
|
+
from google.api_core.retry import Retry
|
46
|
+
|
46
47
|
from airflow.utils.context import Context
|
47
48
|
|
48
49
|
MetaData = Sequence[Tuple[str, str]]
|
@@ -26,7 +26,6 @@ from typing import TYPE_CHECKING, Any, Iterable, Sequence, SupportsAbs
|
|
26
26
|
|
27
27
|
import attr
|
28
28
|
from google.api_core.exceptions import Conflict
|
29
|
-
from google.api_core.retry import Retry
|
30
29
|
from google.cloud.bigquery import DEFAULT_RETRY, CopyJob, ExtractJob, LoadJob, QueryJob
|
31
30
|
from google.cloud.bigquery.table import RowIterator
|
32
31
|
|
@@ -56,6 +55,7 @@ from airflow.providers.google.cloud.triggers.bigquery import (
|
|
56
55
|
from airflow.providers.google.cloud.utils.bigquery import convert_job_id
|
57
56
|
|
58
57
|
if TYPE_CHECKING:
|
58
|
+
from google.api_core.retry import Retry
|
59
59
|
from google.cloud.bigquery import UnknownJob
|
60
60
|
|
61
61
|
from airflow.models.taskinstancekey import TaskInstanceKey
|
@@ -443,6 +443,10 @@ class BigQueryValueCheckOperator(_BigQueryDbHookMixin, SQLValueCheckOperator):
|
|
443
443
|
method_name="execute_complete",
|
444
444
|
)
|
445
445
|
self._handle_job_error(job)
|
446
|
+
# job.result() returns a RowIterator. Mypy expects an instance of SupportsNext[Any] for
|
447
|
+
# the next() call which the RowIterator does not resemble to. Hence, ignore the arg-type error.
|
448
|
+
records = next(job.result()) # type: ignore[arg-type]
|
449
|
+
self.check_value(records)
|
446
450
|
self.log.info("Current state of job %s is %s", job.job_id, job.state)
|
447
451
|
|
448
452
|
@staticmethod
|
@@ -1039,7 +1043,7 @@ class BigQueryGetDataOperator(GoogleCloudBaseOperator):
|
|
1039
1043
|
self.log.info("Total extracted rows: %s", len(rows))
|
1040
1044
|
|
1041
1045
|
if self.as_dict:
|
1042
|
-
table_data = [
|
1046
|
+
table_data = [dict(row) for row in rows]
|
1043
1047
|
else:
|
1044
1048
|
table_data = [row.values() for row in rows]
|
1045
1049
|
|
@@ -23,7 +23,6 @@ from functools import cached_property
|
|
23
23
|
from typing import TYPE_CHECKING, Sequence
|
24
24
|
|
25
25
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
26
|
-
from google.api_core.retry import Retry
|
27
26
|
from google.cloud.bigquery_datatransfer_v1 import (
|
28
27
|
StartManualTransferRunsResponse,
|
29
28
|
TransferConfig,
|
@@ -39,6 +38,8 @@ from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseO
|
|
39
38
|
from airflow.providers.google.cloud.triggers.bigquery_dts import BigQueryDataTransferRunTrigger
|
40
39
|
|
41
40
|
if TYPE_CHECKING:
|
41
|
+
from google.api_core.retry import Retry
|
42
|
+
|
42
43
|
from airflow.utils.context import Context
|
43
44
|
|
44
45
|
|
@@ -18,12 +18,9 @@
|
|
18
18
|
"""This module contains Google Cloud Bigtable operators."""
|
19
19
|
from __future__ import annotations
|
20
20
|
|
21
|
-
import enum
|
22
21
|
from typing import TYPE_CHECKING, Iterable, Sequence
|
23
22
|
|
24
23
|
import google.api_core.exceptions
|
25
|
-
from google.cloud.bigtable import enums
|
26
|
-
from google.cloud.bigtable.column_family import GarbageCollectionRule
|
27
24
|
|
28
25
|
from airflow.exceptions import AirflowException
|
29
26
|
from airflow.providers.google.cloud.hooks.bigtable import BigtableHook
|
@@ -35,6 +32,11 @@ from airflow.providers.google.cloud.links.bigtable import (
|
|
35
32
|
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
36
33
|
|
37
34
|
if TYPE_CHECKING:
|
35
|
+
import enum
|
36
|
+
|
37
|
+
from google.cloud.bigtable import enums
|
38
|
+
from google.cloud.bigtable.column_family import GarbageCollectionRule
|
39
|
+
|
38
40
|
from airflow.utils.context import Context
|
39
41
|
|
40
42
|
|
@@ -17,9 +17,8 @@
|
|
17
17
|
# under the License.
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
|
-
from typing import Sequence
|
20
|
+
from typing import TYPE_CHECKING, Sequence
|
21
21
|
|
22
|
-
from google.api_core import operation # type: ignore
|
23
22
|
from google.cloud.batch_v1 import Job, Task
|
24
23
|
|
25
24
|
from airflow.configuration import conf
|
@@ -27,7 +26,11 @@ from airflow.exceptions import AirflowException
|
|
27
26
|
from airflow.providers.google.cloud.hooks.cloud_batch import CloudBatchHook
|
28
27
|
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
29
28
|
from airflow.providers.google.cloud.triggers.cloud_batch import CloudBatchJobFinishedTrigger
|
30
|
-
|
29
|
+
|
30
|
+
if TYPE_CHECKING:
|
31
|
+
from google.api_core import operation
|
32
|
+
|
33
|
+
from airflow.utils.context import Context
|
31
34
|
|
32
35
|
|
33
36
|
class CloudBatchSubmitJobOperator(GoogleCloudBaseOperator):
|
@@ -25,7 +25,6 @@ from typing import TYPE_CHECKING, Any, Sequence
|
|
25
25
|
from urllib.parse import unquote, urlsplit
|
26
26
|
|
27
27
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
28
|
-
from google.api_core.retry import Retry
|
29
28
|
from google.cloud.devtools.cloudbuild_v1.types import Build, BuildTrigger, RepoSource
|
30
29
|
|
31
30
|
from airflow.configuration import conf
|
@@ -44,6 +43,8 @@ from airflow.utils import yaml
|
|
44
43
|
from airflow.utils.helpers import exactly_one
|
45
44
|
|
46
45
|
if TYPE_CHECKING:
|
46
|
+
from google.api_core.retry import Retry
|
47
|
+
|
47
48
|
from airflow.utils.context import Context
|
48
49
|
|
49
50
|
|
@@ -21,10 +21,8 @@ from typing import TYPE_CHECKING, Sequence
|
|
21
21
|
|
22
22
|
from google.api_core.exceptions import AlreadyExists
|
23
23
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
24
|
-
from google.api_core.retry import Retry
|
25
24
|
from google.cloud.orchestration.airflow.service_v1 import ImageVersion
|
26
25
|
from google.cloud.orchestration.airflow.service_v1.types import Environment
|
27
|
-
from google.protobuf.field_mask_pb2 import FieldMask
|
28
26
|
|
29
27
|
from airflow import AirflowException
|
30
28
|
from airflow.configuration import conf
|
@@ -35,6 +33,9 @@ from airflow.providers.google.cloud.triggers.cloud_composer import CloudComposer
|
|
35
33
|
from airflow.providers.google.common.consts import GOOGLE_DEFAULT_DEFERRABLE_METHOD_NAME
|
36
34
|
|
37
35
|
if TYPE_CHECKING:
|
36
|
+
from google.api_core.retry import Retry
|
37
|
+
from google.protobuf.field_mask_pb2 import FieldMask
|
38
|
+
|
38
39
|
from airflow.utils.context import Context
|
39
40
|
|
40
41
|
CLOUD_COMPOSER_BASE_LINK = "https://console.cloud.google.com/composer/environments"
|
@@ -28,10 +28,8 @@ from __future__ import annotations
|
|
28
28
|
from typing import TYPE_CHECKING, Sequence
|
29
29
|
|
30
30
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
31
|
-
from google.api_core.retry import Retry
|
32
31
|
from google.cloud.memcache_v1beta2.types import cloud_memcache
|
33
32
|
from google.cloud.redis_v1 import FailoverInstanceRequest, InputConfig, Instance, OutputConfig
|
34
|
-
from google.protobuf.field_mask_pb2 import FieldMask
|
35
33
|
|
36
34
|
from airflow.providers.google.cloud.hooks.cloud_memorystore import (
|
37
35
|
CloudMemorystoreHook,
|
@@ -46,6 +44,9 @@ from airflow.providers.google.cloud.links.cloud_memorystore import (
|
|
46
44
|
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
47
45
|
|
48
46
|
if TYPE_CHECKING:
|
47
|
+
from google.api_core.retry import Retry
|
48
|
+
from google.protobuf.field_mask_pb2 import FieldMask
|
49
|
+
|
49
50
|
from airflow.utils.context import Context
|
50
51
|
|
51
52
|
|
@@ -19,9 +19,7 @@ from __future__ import annotations
|
|
19
19
|
|
20
20
|
from typing import TYPE_CHECKING, Sequence
|
21
21
|
|
22
|
-
from google.api_core import operation
|
23
22
|
from google.cloud.run_v2 import Job
|
24
|
-
from google.cloud.run_v2.types import Execution
|
25
23
|
|
26
24
|
from airflow.configuration import conf
|
27
25
|
from airflow.exceptions import AirflowException
|
@@ -30,6 +28,9 @@ from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseO
|
|
30
28
|
from airflow.providers.google.cloud.triggers.cloud_run import CloudRunJobFinishedTrigger, RunJobStatus
|
31
29
|
|
32
30
|
if TYPE_CHECKING:
|
31
|
+
from google.api_core import operation
|
32
|
+
from google.cloud.run_v2.types import Execution
|
33
|
+
|
33
34
|
from airflow.utils.context import Context
|
34
35
|
|
35
36
|
|