Skip to content

Commit

Permalink
Use our yaml util in all providers (#24720)
Browse files Browse the repository at this point in the history
Our yaml util, which uses libyaml where possible, has been available in
core since 2.0.2. Providers now require 2.2.0+, so we can safely use it
now.
  • Loading branch information
jedcunningham authored Jun 29, 2022
1 parent c15cf6e commit 45b11d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/amazon/aws/hooks/eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
from functools import partial
from typing import Callable, Dict, Generator, List, Optional

import yaml
from botocore.exceptions import ClientError
from botocore.signers import RequestSigner

from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
from airflow.utils import yaml
from airflow.utils.json import AirflowJsonEncoder

DEFAULT_PAGINATION_TOKEN = ''
Expand Down
9 changes: 2 additions & 7 deletions airflow/providers/cncf/kubernetes/hooks/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@
from kubernetes.config import ConfigException

from airflow.compat.functools import cached_property
from airflow.kubernetes.kube_client import _disable_verify_ssl, _enable_tcp_keepalive

try:
import airflow.utils.yaml as yaml
except ImportError:
import yaml # type: ignore[no-redef]

from airflow.exceptions import AirflowException
from airflow.hooks.base import BaseHook
from airflow.kubernetes.kube_client import _disable_verify_ssl, _enable_tcp_keepalive
from airflow.utils import yaml


def _load_body_to_dict(body):
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/operators/cloud_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Tuple, Union
from urllib.parse import unquote, urlparse

import yaml
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
from google.api_core.retry import Retry
from google.cloud.devtools.cloudbuild_v1.types import Build, BuildTrigger, RepoSource

from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.cloud_build import CloudBuildHook
from airflow.utils import yaml

if TYPE_CHECKING:
from airflow.utils.context import Context
Expand Down

0 comments on commit 45b11d4

Please sign in to comment.
  翻译: