Skip to content

Commit

Permalink
add write support explicitly for pyarrow dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco authored and rtyler committed Oct 27, 2023
1 parent e5d2da3 commit 0ad02d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/deltalake/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def write_deltalake(
table_or_uri: Union[str, Path, DeltaTable],
data: Union[
"pd.DataFrame",
ds.Dataset,
pa.Table,
pa.RecordBatch,
Iterable[pa.RecordBatch],
Expand Down Expand Up @@ -331,6 +332,8 @@ def validate_batch(batch: pa.RecordBatch) -> pa.RecordBatch:
batch_iter = [data]
elif isinstance(data, pa.Table):
batch_iter = data.to_batches()
elif isinstance(data, ds.Dataset):
batch_iter = data.to_batches()
else:
batch_iter = data

Expand Down

0 comments on commit 0ad02d4

Please sign in to comment.