Skip to content

Commit

Permalink
Update python/tests/test_writer.py
Browse files Browse the repository at this point in the history
Co-authored-by: Will Jones <[email protected]>
  • Loading branch information
ion-elgreco and wjones127 committed Nov 20, 2023
1 parent 43ec367 commit 7c191a2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,19 @@ def test_write_iterator(
assert DeltaTable(tmp_path).to_pyarrow_table() == sample_data


@pytest.parametrize("large_dtypes", [True, False])
@pytest.parametrize("constructor", [
lambda table: table.to_pyarrow_dataset(),
lambda table: table.to_pyarrow_table(),
lambda table: table.to_pyarrow_table().to_batches()[0]
])
def test_write_dataset(
tmp_path: pathlib.Path, existing_table: DeltaTable, sample_data: pa.Table
tmp_path: pathlib.Path, existing_table: DeltaTable, sample_data: pa.Table,
large_dtypes: bool, constructor
):
dataset = existing_table.to_pyarrow_dataset()
dataset = constructor(existing_table)

write_deltalake(tmp_path, dataset, mode="overwrite")
write_deltalake(tmp_path, dataset, mode="overwrite", large_dtypes=large_dtypes)
assert DeltaTable(tmp_path).to_pyarrow_table() == sample_data


Expand Down

0 comments on commit 7c191a2

Please sign in to comment.