Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from airflow.providers.google.version_compat import BaseOperator

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class GoogleAdsListAccountsOperator(BaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from airflow.providers.google.version_compat import BaseOperator

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class GoogleAdsToGcsOperator(BaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,14 @@

from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.providers.common.compat.lineage.hook import get_hook_lineage_collector
from airflow.providers.common.compat.sdk import timezone
from airflow.providers.google.cloud.utils.helpers import normalize_directory_path
from airflow.providers.google.common.consts import CLIENT_INFO
from airflow.providers.google.common.hooks.base_google import (
PROVIDE_PROJECT_ID,
GoogleBaseAsyncHook,
GoogleBaseHook,
)

try:
from airflow.sdk import timezone
except ImportError:
from airflow.utils import timezone # type: ignore[attr-defined,no-redef]
from airflow.version import version

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

if TYPE_CHECKING:
from airflow.models.taskinstancekey import TaskInstanceKey
from airflow.providers.common.compat.sdk import Context
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
from airflow.utils.context import Context

BASE_LINK = "https://console.cloud.google.com"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from airflow.providers.google.cloud.links.base import BaseGoogleLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

CLOUD_STORAGE_TRANSFER_BASE_LINK = "https://console.cloud.google.com/transfer"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from airflow.providers.google.cloud.links.base import BaseGoogleLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

CLOUD_TASKS_BASE_LINK = "/cloudtasks"
CLOUD_TASKS_QUEUE_LINK = CLOUD_TASKS_BASE_LINK + "/queue/{location}/{queue_id}/tasks?project={project_id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

if TYPE_CHECKING:
from airflow.models.taskinstancekey import TaskInstanceKey
from airflow.providers.common.compat.sdk import Context
from airflow.providers.google.version_compat import BaseOperator
from airflow.utils.context import Context


def __getattr__(name: str) -> Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from airflow.providers.google.cloud.links.base import BaseGoogleLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

KUBERNETES_BASE_LINK = "/kubernetes"
KUBERNETES_CLUSTER_LINK = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from airflow.providers.google.cloud.links.base import BASE_LINK, BaseGoogleLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


TRANSLATION_BASE_LINK = BASE_LINK + "/translation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from airflow.providers.google.cloud.links.base import BaseGoogleLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

VERTEX_AI_BASE_LINK = "/vertex-ai"
VERTEX_AI_MODEL_LINK = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from google.cloud.bigquery.table import Table

from airflow.providers.common.compat.openlineage.facet import Dataset
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


log = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class AlloyDBBaseOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if TYPE_CHECKING:
from google.api_core.retry import Retry

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

MetaData = Sequence[tuple[str, str]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from google.api_core.retry import Retry
from google.cloud.bigquery import UnknownJob

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


BIGQUERY_JOB_DETAILS_LINK_FMT = "https://console.cloud.google.com/bigquery?j={job_id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if TYPE_CHECKING:
from google.api_core.retry import Retry

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


def _get_transfer_config_details(config_transfer_name: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from google.cloud.bigtable import enums
from google.cloud.bigtable.column_family import GarbageCollectionRule

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class BigtableValidationMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if TYPE_CHECKING:
from google.api_core import operation

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CloudBatchSubmitJobOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
if TYPE_CHECKING:
from google.api_core.retry import Retry

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


REGEX_REPO_PATH = re.compile(r"^/(?P<project_id>[^/]+)/(?P<repo_name>[^/]+)[\+/]*(?P<branch_name>[^:]+)?")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

CLOUD_COMPOSER_BASE_LINK = "https://console.cloud.google.com/composer/environments"
CLOUD_COMPOSER_DETAILS_LINK = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if TYPE_CHECKING:
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


def _validate_inputs(obj, required_fields: list[str]) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CloudMemorystoreCreateInstanceOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from google.api_core import operation
from google.cloud.run_v2.types import Execution

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CloudRunCreateJobOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

if TYPE_CHECKING:
from airflow.models import Connection
from airflow.providers.common.compat.sdk import Context
from airflow.providers.openlineage.extractors import OperatorLineage
from airflow.utils.context import Context


SETTINGS = "settings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.providers.common.compat.sdk import Context
from airflow.providers.openlineage.extractors import OperatorLineage
from airflow.utils.context import Context


class TransferJobPreprocessor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if TYPE_CHECKING:
from google.api_core.retry import Retry

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class ComputeEngineBaseOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


@deprecated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CheckJobRunning(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if TYPE_CHECKING:
from google.api_core.retry import Retry

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
from google.cloud.dataform_v1beta1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.providers.common.compat.sdk import Context
from airflow.providers.openlineage.extractors import OperatorLineage
from airflow.utils.context import Context


class CloudDataFusionRestartInstanceOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
if TYPE_CHECKING:
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

from google.api_core.exceptions import AlreadyExists, GoogleAPICallError, NotFound
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class DataprepGetJobsForJobGroupOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
from google.protobuf.field_mask_pb2 import FieldMask
from google.type.interval_pb2 import Interval

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class PreemptibilityType(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.models.taskinstancekey import TaskInstanceKey
from airflow.providers.common.compat.sdk import Context
from airflow.providers.google.version_compat import BaseOperator
from airflow.utils.context import Context

BASE_LINK = "https://console.cloud.google.com"
METASTORE_BASE_LINK = BASE_LINK + "/dataproc/metastore/services/{region}/{service_id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from airflow.providers.google.common.links.storage import StorageLink

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CloudDatastoreExportEntitiesOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class CloudDLPCancelDLPJobOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from airflow.version import version

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


def _validate_available_memory_in_mb(value):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

from google.api_core.exceptions import Conflict
from google.cloud.exceptions import GoogleCloudError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
TuningDatasetOrDict,
)

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class GenAIGenerateEmbeddingsOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
from kubernetes.client.models import V1Job
from pendulum import DateTime

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context

KUBE_CONFIG_ENV_VAR = "KUBECONFIG"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class LookerStartPdtBuildOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from google.api_core.retry import Retry
from google.protobuf.field_mask_pb2 import FieldMask

from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


class ManagedKafkaBaseOperator(GoogleCloudBaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID

if TYPE_CHECKING:
from airflow.utils.context import Context
from airflow.providers.common.compat.sdk import Context


log = logging.getLogger(__name__)
Expand Down
Loading