Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
omkar-foss committed Jan 20, 2025
1 parent 7d29885 commit 6434a27
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2031,3 +2031,33 @@ def test_write_structs(tmp_path: pathlib.Path):
arrow_dt = dt.to_pyarrow_dataset()
new_df = pl.scan_pyarrow_dataset(arrow_dt)
new_df.collect()


@pytest.mark.polars
def test_write_binary_col(tmp_path: pathlib.Path):
import polars as pl

data_with_bin_col = {"bin_col": [b"12345", b"67890"], "id": [1, 2]}

df_with_bin_col = pl.DataFrame(data_with_bin_col)
df_with_bin_col.write_delta(tmp_path)

assert len(df_with_bin_col.rows()) == 2


# <https://github.com/delta-io/delta-rs/issues/2854>
@pytest.mark.polars
def test_write_binary_col_with_dssc(tmp_path: pathlib.Path):
import polars as pl

data_with_bin_col = {"bin_col": [b"12345", b"67890"], "id": [1, 2]}

df_with_bin_col = pl.DataFrame(data_with_bin_col)
df_with_bin_col.write_delta(
tmp_path,
delta_write_options={
"configuration": {"delta.dataSkippingStatsColumns": "bin_col"},
},
)

assert len(df_with_bin_col.rows()) == 2

0 comments on commit 6434a27

Please sign in to comment.