Skip to content

Commit

Permalink
add warn stacklevel=2 to ssh hook (#34527)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxmahoney committed Sep 21, 2023
1 parent a1bd871 commit 06965e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions airflow/providers/ssh/hooks/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(
"Extra option `timeout` is deprecated."
"Please use `conn_timeout` instead."
"The old option `timeout` will be removed in a future version.",
AirflowProviderDeprecationWarning,
category=AirflowProviderDeprecationWarning,
stacklevel=2,
)
self.timeout = int(extra_options["timeout"])
Expand Down Expand Up @@ -233,8 +233,8 @@ def __init__(
"Parameter `timeout` is deprecated."
"Please use `conn_timeout` instead."
"The old option `timeout` will be removed in a future version.",
AirflowProviderDeprecationWarning,
stacklevel=1,
category=AirflowProviderDeprecationWarning,
stacklevel=2,
)

if self.conn_timeout is None:
Expand Down Expand Up @@ -371,6 +371,7 @@ def __enter__(self) -> SSHHook:
"Please use get_conn() as a contextmanager instead."
"This method will be removed in Airflow 2.0",
category=AirflowProviderDeprecationWarning,
stacklevel=2,
)
return self

Expand Down Expand Up @@ -436,6 +437,7 @@ def create_tunnel(
"order of the parameters have changed"
"This method will be removed in Airflow 2.0",
category=AirflowProviderDeprecationWarning,
stacklevel=2,
)

return self.get_tunnel(remote_port, remote_host, local_port)
Expand Down

0 comments on commit 06965e6

Please sign in to comment.