From 70f2f354505e532851c28202aa0e1d7a81049308 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 08:40:24 +0000 Subject: [PATCH] Fix mypy --- astronomer/providers/google/cloud/hooks/dataproc.py | 5 ++--- astronomer/providers/snowflake/hooks/snowflake_sql_api.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/astronomer/providers/google/cloud/hooks/dataproc.py b/astronomer/providers/google/cloud/hooks/dataproc.py index 2667668d0..50db65145 100644 --- a/astronomer/providers/google/cloud/hooks/dataproc.py +++ b/astronomer/providers/google/cloud/hooks/dataproc.py @@ -3,9 +3,8 @@ from airflow.providers.google.common.consts import CLIENT_INFO from airflow.providers.google.common.hooks.base_google import GoogleBaseHook -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, retry_async as retries from google.api_core.client_options import ClientOptions -from google.api_core import retry_async as retries from google.cloud.dataproc_v1 import ( ClusterControllerAsyncClient, Job, @@ -16,7 +15,7 @@ try: OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] JobType = Union[Job, Any] diff --git a/astronomer/providers/snowflake/hooks/snowflake_sql_api.py b/astronomer/providers/snowflake/hooks/snowflake_sql_api.py index e6e2601d0..1ef615511 100644 --- a/astronomer/providers/snowflake/hooks/snowflake_sql_api.py +++ b/astronomer/providers/snowflake/hooks/snowflake_sql_api.py @@ -143,7 +143,7 @@ def execute_query( if e.response is None: raise e raise AirflowException( - f"Response: {e.response.content}, " f"Status Code: {e.response.status_code}" + f"Response: {e.response.content!r}, " f"Status Code: {e.response.status_code}" ) # pragma: no cover json_response = response.json() self.log.info("Snowflake SQL POST API response: %s", json_response) @@ -208,7 +208,7 @@ def check_query_output(self, query_ids: list[str]) -> None: if e.response is None: raise e raise AirflowException( - f"Response: {e.response.content}, Status Code: {e.response.status_code}" + f"Response: {e.response.content!r}, Status Code: {e.response.status_code}" ) @staticmethod