uranusjr commented on a change in pull request #17236:
URL: https://github.com/apache/airflow/pull/17236#discussion_r678748100
##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -148,7 +155,17 @@ def __init__(
self.pkey = self._pkey_from_private_key(private_key,
passphrase=private_key_passphrase)
if "timeout" in extra_options:
- self.timeout = int(extra_options["timeout"], 10)
+ warnings.warn(
+ 'Extra option `timeout` is deprecated.'
+ 'Please use `conn_timeout` instead.'
+ 'The old option `timeout` will be removed in a future
version.',
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self.timeout = int(extra_options.get('timeout', 10))
Review comment:
```suggestion
self.timeout = int(extra_options['timeout'])
```
We already know `"timeout"` is in `extra_options` (the `if` check above),
this `get()` is not needed.
##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -148,7 +155,17 @@ def __init__(
self.pkey = self._pkey_from_private_key(private_key,
passphrase=private_key_passphrase)
if "timeout" in extra_options:
- self.timeout = int(extra_options["timeout"], 10)
+ warnings.warn(
+ 'Extra option `timeout` is deprecated.'
+ 'Please use `conn_timeout` instead.'
+ 'The old option `timeout` will be removed in a future
version.',
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self.timeout = int(extra_options.get('timeout', 10))
+
+ if "conn_timeout" in extra_options:
+ self.conn_timeout = int(extra_options.get('conn_timeout'))
Review comment:
```suggestion
self.conn_timeout = int(extra_options['conn_timeout'])
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]