Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar P <[email protected]>
  • Loading branch information
omkar-foss committed Jan 21, 2025
1 parent 82ef6bf commit 615c3a5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2046,3 +2046,32 @@ def test_write_type_coercion_predicate(tmp_path: pathlib.Path):
mode="overwrite",
delta_write_options=dict(engine="rust", predicate="C = 'a'"),
)

@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 615c3a5

Please sign in to comment.