guan404ming commented on code in PR #70302:
URL: https://github.com/apache/airflow/pull/70302#discussion_r3771876967
##########
providers/common/ai/tests/unit/common/ai/utils/test_file_analysis.py:
##########
@@ -378,19 +383,43 @@ def
test_detect_file_format_rejects_unsupported_compression(self, tmp_path):
with pytest.raises(LLMFileAnalysisUnsupportedFormatError,
match="Compression"):
detect_file_format(ObjectStoragePath(str(path)))
- @pytest.mark.parametrize("filename", ["sample.parquet.gz",
"sample.avro.gz", "sample.png.gz"])
- def
test_detect_file_format_rejects_unsupported_gzip_format_combinations(self,
tmp_path, filename):
+ @pytest.mark.parametrize(("filename", "codec"), [("events.csv.bz2",
"bzip2"), ("events.json.xz", "xz")])
+ def test_detect_file_format_rejects_compression_without_codec_module(self,
tmp_path, filename, codec):
path = tmp_path / filename
path.write_bytes(b"content")
- with pytest.raises(LLMFileAnalysisUnsupportedFormatError, match="not
supported for"):
+ with patch.dict(_DECOMPRESSORS, {"gzip": gzip.open}, clear=True):
Review Comment:
Added plain/gzip asserts and importorskip, parametrized per-file expansion;
total-limit test stays gzip-only.
--
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]