Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 1, 2023
1 parent c037d8b commit e40bccb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions astronomer/providers/google/cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
from airflow.utils.process_utils import execute_in_subprocess, patch_environ
from google.auth import default, impersonated_credentials
from google.cloud.container_v1 import ClusterManagerClient

KUBE_CONFIG_ENV_VAR = "KUBECONFIG"

Expand Down Expand Up @@ -79,7 +78,7 @@ def _get_gke_config_file(
target_scopes=["https://www.googleapis.com/auth/cloud-platform"],
)

with open(conf_file.name, "r") as input_file:
with open(conf_file.name) as input_file:
config_content = yaml.safe_load(input_file.read())

config_content["users"][0]["user"]["token"] = impersonated_creds.token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""This module contains Google GKE operators."""
from __future__ import annotations

from typing import Any, Sequence, Union
from typing import Any, Sequence

from airflow.exceptions import AirflowException
from airflow.providers.cncf.kubernetes.hooks.kubernetes import KubernetesHook
Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(
use_internal_ip: bool = False,
project_id: str | None = None,
gcp_conn_id: str = "google_cloud_default",
impersonation_chain: Union[str, Sequence[str]] | None = None,
impersonation_chain: str | Sequence[str] | None = None,
regional: bool = False,
poll_interval: float = 5,
logging_interval: int | None = None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any, AsyncIterator, Sequence, Union
from typing import Any, AsyncIterator, Sequence

from airflow.providers.cncf.kubernetes.utils.pod_manager import PodPhase
from airflow.triggers.base import TriggerEvent
Expand All @@ -13,7 +13,6 @@
from astronomer.providers.google.cloud import _get_gke_config_file



class GKEStartPodTrigger(WaitContainerTrigger):
"""
Fetch GKE cluster config and wait for pod to start up.
Expand Down Expand Up @@ -46,7 +45,7 @@ def __init__(
use_internal_ip: bool = False,
project_id: str | None = None,
gcp_conn_id: str = "google_cloud_default",
impersonation_chain: Union[str, Sequence[str]] | None = None,
impersonation_chain: str | Sequence[str] | None = None,
regional: bool = False,
cluster_context: str | None = None,
in_cluster: bool | None = None,
Expand Down Expand Up @@ -97,7 +96,7 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
},
)

async def run(self) -> AsyncIterator["TriggerEvent"]:
async def run(self) -> AsyncIterator[TriggerEvent]:
"""Wait for pod to reach terminal state"""
try:
with _get_gke_config_file(
Expand Down

0 comments on commit e40bccb

Please sign in to comment.