shubhamraj-git commented on code in PR #73419:
URL: https://github.com/apache/airflow/pull/73419#discussion_r4063047775
##########
providers/sftp/src/airflow/providers/sftp/hooks/sftp.py:
##########
@@ -477,7 +477,10 @@ def retrieve_file_chunk(
remote_file_chunks = [remote_file_paths[i::workers] for i in
range(workers)]
local_file_chunks = [new_local_file_paths[i::workers] for i in
range(workers)]
self.log.info("Opening %s new SFTP connections", workers)
- conns = [SFTPHook(ssh_conn_id=self.ssh_conn_id).get_conn() for _ in
range(workers)]
+ conns = [
+ SFTPHook(ssh_conn_id=self.ssh_conn_id,
no_host_key_check=self.no_host_key_check).get_conn()
Review Comment:
This introduces a runtime dependency on the new
`SSHHook.__init__(no_host_key_check=...)` API, but
`providers/sftp/pyproject.toml` still allows SSH provider 6.0.0/6.0.1, whose
constructor does not accept this keyword. A separately installed new SFTP
provider with SSH 6.0.x will crash here during concurrent directory transfers;
it will also retain the old permissive default for normal synchronous hooks.
Please mark the SSH dependency with `# use next version` so release preparation
raises the SFTP package's minimum SSH-provider version.
---
Drafted-by: Codex (GPT-5); reviewed by @shubhamraj-git before posting
##########
providers/ssh/src/airflow/providers/ssh/hooks/ssh.py:
##########
@@ -619,7 +645,7 @@ def _parse_extras(self, conn: Any) -> None:
host_key = extra_options.get("host_key")
nhkc_raw = extra_options.get("no_host_key_check")
- no_host_key_check = str(nhkc_raw).lower() == "true" if nhkc_raw is not
None else True
+ no_host_key_check = str(nhkc_raw).lower() == "true" if nhkc_raw is not
None else False
Review Comment:
The async parser only reads `no_host_key_check`, so a connection using the
compatibility alias added by this PR still switches from permissive behavior to
verification here. This is especially visible in `SSHRemoteJobOperator`:
synchronous submission honors the alias, but its async trigger ignores it and
can fail while reconnecting. `SFTPHookAsync` has the same gap, affecting
deferrable SFTP sensors and the client pool. Please resolve
`ignore_hostkey_verification` in both async parsers, with canonical-key
precedence and the deprecation warning, and test both paths.
---
Drafted-by: Codex (GPT-5); reviewed by @shubhamraj-git 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]