You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/09/22 23:21:46 UTC
[I] SFTPHookAsync lets a connection known_hosts extra override an explicit constructor path [airflow]
potiuk opened a new issue, #73584:
URL: https://github.com/apache/airflow/issues/73584
`SFTPHookAsync._parse_extras()` decides whether to take `known_hosts` from the connection extras with:
```python
if "known_hosts" in extra_options and self.known_hosts != self.default_known_hosts:
self.known_hosts = extra_options["known_hosts"]
```
`self.known_hosts` has already been through `os.path.expanduser()` in `__init__`, while `default_known_hosts` is the literal `"~/.ssh/known_hosts"`. The two never compare equal, so the condition is always true whenever the extra is present: a connection-level `known_hosts` overrides even a path passed explicitly to the constructor. `SSHHookAsync` gets this right — it compares against the expanded default and only falls back to the extra when the constructor left the default in place.
**Expected:** an explicit constructor path wins; the extra applies only when the constructor used the default — consistent with `SSHHookAsync`.
**Regression test:** construct `SFTPHookAsync(known_hosts="/explicit/known_hosts")`, parse a connection with `{"known_hosts": "/connection/known_hosts"}`, and assert `/explicit/known_hosts` is kept.
Pre-existing; surfaced during review of #73419 and deliberately left out of that PR's scope.
---
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] SFTPHookAsync lets a connection known_hosts extra override an explicit constructor path [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 closed issue #73584: SFTPHookAsync lets a connection known_hosts extra override an explicit constructor path
URL: https://github.com/apache/airflow/issues/73584
--
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
Re: [I] SFTPHookAsync lets a connection known_hosts extra override an explicit constructor path [airflow]
Posted by "abhishekmauryaKsolves (via GitHub)" <gi...@apache.org>.
abhishekmauryaKsolves commented on issue #73584:
URL: https://github.com/apache/airflow/issues/73584#issuecomment-5790194143
Hi @potiuk, I'd like to work on this issue. I'll fix the comparison in SFTPHookAsync._parse_extras() to compare against the expanded default (matching SSHHookAsync's pattern) and add the regression test as described.
--
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