guan404ming commented on code in PR #70302:
URL: https://github.com/apache/airflow/pull/70302#discussion_r3771874882
##########
providers/common/ai/src/airflow/providers/common/ai/utils/file_analysis.py:
##########
@@ -536,10 +552,10 @@ def _render_avro(path: ObjectStoragePath, *, sample_rows:
int, max_content_bytes
def _read_raw_bytes(path: ObjectStoragePath, *, compression: str | None,
max_bytes: int) -> bytes:
with path.open("rb") as handle:
- if compression == "gzip":
- with gzip.GzipFile(fileobj=handle) as gzip_handle:
- return _read_limited_bytes(gzip_handle, path=path,
max_bytes=max_bytes)
- return _read_limited_bytes(handle, path=path, max_bytes=max_bytes)
+ if compression is None:
+ return _read_limited_bytes(handle, path=path, max_bytes=max_bytes)
+ with _DECOMPRESSORS[compression](handle) as decompressed:
Review Comment:
Pinned current behavior in tests and documented the limitation;
decompressor-level detection deferred.
--
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]