File tree Expand file tree Collapse file tree 3 files changed +13
-24
lines changed
Expand file tree Collapse file tree 3 files changed +13
-24
lines changed Original file line number Diff line number Diff line change 4545from airflow .providers .google .cloud .utils .helpers import normalize_directory_path
4646from airflow .providers .google .common .consts import CLIENT_INFO
4747from airflow .providers .google .common .hooks .base_google import GoogleBaseAsyncHook , GoogleBaseHook
48+ from airflow .typing_compat import ParamSpec
4849from airflow .utils import timezone
4950from airflow .version import version
5051
5455 from aiohttp import ClientSession
5556 from google .api_core .retry import Retry
5657
57- try :
58- # Airflow 2.3 doesn't have this yet
59- from airflow .typing_compat import ParamSpec
60- except ImportError :
61- try :
62- from typing import ParamSpec # type: ignore[no-redef, attr-defined]
63- except ImportError :
64- from typing_extensions import ParamSpec
6558
6659RT = TypeVar ("RT" )
6760T = TypeVar ("T" , bound = Callable )
Original file line number Diff line number Diff line change 2828from airflow .providers .google .cloud .utils .credentials_provider import get_credentials_and_project_id
2929from airflow .secrets import BaseSecretsBackend
3030from airflow .utils .log .logging_mixin import LoggingMixin
31- from airflow .version import version as airflow_version
3231
3332log = logging .getLogger (__name__ )
3433
@@ -154,13 +153,12 @@ def get_conn_uri(self, conn_id: str) -> str | None:
154153 :param conn_id: the connection id
155154 :return: deserialized Connection
156155 """
157- if _parse_version (airflow_version ) >= (2 , 3 ):
158- warnings .warn (
159- f"Method `{ self .__class__ .__name__ } .get_conn_uri` is deprecated and will be removed "
160- "in a future release. Please use method `get_conn_value` instead." ,
161- AirflowProviderDeprecationWarning ,
162- stacklevel = 2 ,
163- )
156+ warnings .warn (
157+ f"Method `{ self .__class__ .__name__ } .get_conn_uri` is deprecated and will be removed "
158+ "in a future release. Please use method `get_conn_value` instead." ,
159+ AirflowProviderDeprecationWarning ,
160+ stacklevel = 2 ,
161+ )
164162 return self .get_conn_value (conn_id )
165163
166164 def get_variable (self , key : str ) -> str | None :
Original file line number Diff line number Diff line change 3838from airflow .providers .microsoft .azure .utils import get_sync_default_azure_credential
3939from airflow .secrets import BaseSecretsBackend
4040from airflow .utils .log .logging_mixin import LoggingMixin
41- from airflow .version import version as airflow_version
4241
4342
4443def _parse_version (val ):
@@ -170,13 +169,12 @@ def get_conn_uri(self, conn_id: str) -> str | None:
170169 :param conn_id: the connection id
171170 :return: deserialized Connection
172171 """
173- if _parse_version (airflow_version ) >= (2 , 3 ):
174- warnings .warn (
175- f"Method `{ self .__class__ .__name__ } .get_conn_uri` is deprecated and will be removed "
176- "in a future release. Please use method `get_conn_value` instead." ,
177- AirflowProviderDeprecationWarning ,
178- stacklevel = 2 ,
179- )
172+ warnings .warn (
173+ f"Method `{ self .__class__ .__name__ } .get_conn_uri` is deprecated and will be removed "
174+ "in a future release. Please use method `get_conn_value` instead." ,
175+ AirflowProviderDeprecationWarning ,
176+ stacklevel = 2 ,
177+ )
180178 return self .get_conn_value (conn_id )
181179
182180 def get_variable (self , key : str ) -> str | None :
You can’t perform that action at this time.
0 commit comments