Vamsi-klu opened a new pull request, #72132:
URL: https://github.com/apache/airflow/pull/72132

   closes: #34995
   
   `#48107` already added `use_stream`. This is leftover, not a second 
streaming PR.
   
   On the stream path, `gzip` and `mime_type` were ignored (the tempfile path 
still applied them). The stream unit test only asserted 
`upload.assert_not_called()`, so a tempfile regression that still opened the 
blob would pass. How-to docs never mentioned `use_stream`.
   
   This PR:
   - sets blob `content_type` from `mime_type` before `open`
   - wraps `gzip.GzipFile` when `gzip=True`, with `ignore_flush=True` so 
`GzipFile.close()` does not crash on `BlobWriter.flush()`
   - does not set `Content-Encoding` (matches tempfile/`GCSHook.upload`)
   - tightens tests: `NamedTemporaryFile` not used, `retrieve_file` sink is 
file-like, gzip wrap, wildcard+stream
   - documents `use_stream` and `sftp_prefetch=False` for large files
   - one system-test task with `use_stream=True`
   - floors the google `sftp` extra at `apache-airflow-providers-sftp>=5.3.3` 
(`BlobWriter` needs that; 5.1.0 only covered `BytesIO`)
   
   Default stays `use_stream=False`. No second flag. GCSToSFTP streaming is out 
of scope.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes
   
   Generated-by: Cursor Grok 4.6 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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