Skip to content

Commit 5030d49

Browse files
committed
Add another test
1 parent 4f529e5 commit 5030d49

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/integration/test_writes/test_writes.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from typing import Any, Dict
2626
from urllib.parse import urlparse
2727

28+
import fastavro
2829
import pandas as pd
2930
import pandas.testing
3031
import pyarrow as pa
@@ -1841,3 +1842,22 @@ def test_read_write_decimals(session_catalog: Catalog) -> None:
18411842
tbl.append(arrow_table)
18421843

18431844
assert tbl.scan().to_arrow() == arrow_table
1845+
1846+
1847+
@pytest.mark.integration
1848+
def test_avro_compression_codecs(session_catalog: Catalog, arrow_table_with_null: pa.Table) -> None:
1849+
identifier = "default.test_avro_compression_codecs"
1850+
tbl = _create_table(session_catalog, identifier, schema=arrow_table_with_null.schema, data=[arrow_table_with_null])
1851+
1852+
with tbl.io.new_input(tbl.current_snapshot().manifest_list).open() as f:
1853+
reader = fastavro.reader(f)
1854+
assert reader.codec == "deflate"
1855+
1856+
with tbl.transaction() as tx:
1857+
tx.set_properties(**{TableProperties.WRITE_AVRO_COMPRESSION: "null"})
1858+
1859+
tbl.append(arrow_table_with_null)
1860+
1861+
with tbl.io.new_input(tbl.current_snapshot().manifest_list).open() as f:
1862+
reader = fastavro.reader(f)
1863+
assert reader.codec == "null"

0 commit comments

Comments
 (0)