uranusjr commented on code in PR #34378:
URL: https://github.com/apache/airflow/pull/34378#discussion_r1326785221
##########
airflow/providers/google/cloud/hooks/gcs.py:
##########
@@ -566,10 +566,10 @@ def _call_with_retry(f: Callable[[], None]) -> None:
if gzip:
if isinstance(data, str):
data = bytes(data, encoding)
- out = BytesIO()
- with gz.GzipFile(fileobj=out, mode="w") as f:
- f.write(data)
- data = out.getvalue()
+ with BytesIO() as out:
+ with gz.GzipFile(fileobj=out, mode="w") as f:
+ f.write(data)
+ data = out.getvalue()
Review Comment:
```suggestion
with BytesIO() as out, gz.GzipFile(fileobj=out, mode="w") as
f:
f.write(data)
data = out.getvalue()
```
I believe this works.
--
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]