ignaciojcano commented on issue #49801:
URL: https://github.com/apache/airflow/issues/49801#issuecomment-2835672016

   I looked at the underlying paramiko and it doesn't check if its a BytesIO 
implementation, so I think we could pass the BlobWritter directly, this means 
we would only use the `stfp_hook` to get the client and would ignore any future 
changes that might be done to `retrieve_file`
   
   ```
   # current
   with dest_blob.open("wb") as write_stream:
     sftp_hook.retrieve_file(source_path, write_stream, 
prefetch=self.sftp_prefetch)
   
   # proposed
   with dest_blob.open("wb") as write_stream:
     with sftp_hook.get_managed_conn() as conn:
       conn.getfo(source_path, write_stream, prefetch=self.sftp_prefetch)       
     
   ```


-- 
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]

Reply via email to