Skip to content

Commit

Permalink
make pyarrow 8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
marijncv committed Nov 23, 2023
1 parent fb316e9 commit 2df04a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,14 @@ def get_add_actions(self, flatten: bool = False) -> pyarrow.RecordBatch:
>>> data = pa.table({"x": [1, 2, 3], "y": [4, 5, 6]})
>>> write_deltalake("tmp", data, partition_by=["x"])
>>> dt = DeltaTable("tmp")
>>> dt.get_add_actions().sort_by("path").to_pandas()["partition_values"]
0 {'x': 1}
1 {'x': 2}
2 {'x': 3}
>>> df = dt.get_add_actions().to_pandas()
>>> df["path"].sort_values(ignore_index=True)
0 x=1/0-...
1 x=2/0-...
2 x=3/0-...
...
>>> dt.get_add_actions(flatten=True).sort_by("path").to_pandas()["partition.x"]
>>> df = dt.get_add_actions(flatten=True).to_pandas()
>>> df["partition.x"].sort_values(ignore_index=True)
0 1
1 2
2 3
Expand Down

0 comments on commit 2df04a9

Please sign in to comment.