You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/07 01:31:01 UTC
[GitHub] [airflow] tawsifh opened a new issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
tawsifh opened a new issue #20735:
URL: https://github.com/apache/airflow/issues/20735
### Apache Airflow Provider(s)
sftp
### Versions of Apache Airflow Providers
apache-airflow-providers-amazon==2.6.0
apache-airflow-providers-apache-hdfs==2.2.0
apache-airflow-providers-apache-hive==2.1.0
apache-airflow-providers-apache-livy==2.1.0
apache-airflow-providers-apache-spark==2.0.3
apache-airflow-providers-celery==2.1.0
apache-airflow-providers-elasticsearch==2.1.0
apache-airflow-providers-ftp==2.0.1
apache-airflow-providers-google==4.0.0
apache-airflow-providers-http==2.0.1
apache-airflow-providers-imap==2.0.1
apache-airflow-providers-jira==2.0.1
apache-airflow-providers-postgres==2.4.0
apache-airflow-providers-redis==2.0.1
**apache-airflow-providers-sftp==2.4.0**
apache-airflow-providers-slack==4.1.0
apache-airflow-providers-sqlite==2.0.1
**apache-airflow-providers-ssh==2.3.0**
### Apache Airflow version
2.2.3 (latest released)
### Operating System
Ubuntu 20.04
### Deployment
Other Docker-based deployment
### Deployment details
_No response_
### What happened
I believe this was introduced in this commit https://github.com/apache/airflow/commit/f35ad27080a2e1f29efc20a9bd0613af0f6ff2ec
In File airflow/providers/sftp/hooks/sftp.py
In lines 74-79
```python
def __init__(
self,
ssh_conn_id: Optional[str] = 'sftp_default',
ftp_conn_id: Optional[str] = 'sftp_default',
*args,
**kwargs,
) -> None:
if ftp_conn_id:
warnings.warn(
'Parameter `ftp_conn_id` is deprecated.' 'Please use `ssh_conn_id` instead.',
DeprecationWarning,
stacklevel=2,
)
kwargs['ssh_conn_id'] = ftp_conn_id
self.ssh_conn_id = ssh_conn_id
super().__init__(*args, **kwargs)
```
Since `ftp_conn_id` has a default value of `sftp_default`, it will always override `ssh_conn_id` unless explicitly set to None during init.
### What you expected to happen
If you initialise the hook with `ssh_conn_id` parameter it should use that connection instead of ignoring the parameter and using the default value.
The deprecation message is also triggered despite only passing in `ssh_conn_id`
`<stdin>:1 DeprecationWarning: Parameter `ftp_conn_id` is deprecated.Please use `ssh_conn_id` instead.`
### How to reproduce
```python
from airflow.providers.sftp.hooks.sftp import SFTPHook
hook = SFTPHook(ssh_conn_id='some_custom_sftp_conn_id')
```
There will be a log message stating
`[2022-01-07 01:12:05,234] {base.py:70} INFO - Using connection to: id: sftp_default.`
### Anything else
This breaks the SFTPSensor and SFTPOperator
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil closed issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil closed issue #20735:
URL: https://github.com/apache/airflow/issues/20735
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007813435
Yanked.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007764637
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007679476
@potiuk we should yank `2.4.0` of the SFTP provider, merge #20735 and start the release process for `2.4.1`
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007603661
Assigned this PR to you, let me know if you don't want to work on it. Once we merge the PR, we will start the release process for the new version of this Provider.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007658791
https://github.com/apache/airflow/issues/20735 should fix it
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil closed issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil closed issue #20735:
URL: https://github.com/apache/airflow/issues/20735
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007764637
Yep. Will do
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk edited a comment on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007813435
Yanked 2.4.0
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007067617
Thanks for opening your first issue here! Be sure to follow the issue template!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk edited a comment on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007813435
Yanked 2.4.0
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on issue #20735: SFTPHook uses default connection 'sftp_default' even when ssh_conn_id is passed
Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #20735:
URL: https://github.com/apache/airflow/issues/20735#issuecomment-1007603661
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org