Skip to content

Commit

Permalink
drop the _df
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed Jan 11, 2023
1 parent a9b0b2b commit 8b5bab9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def __stringify_partition_values(
out.append((field, op, str_value))
return out

def get_add_actions_df(self, flatten: bool = False) -> pyarrow.RecordBatch:
def get_add_actions(self, flatten: bool = False) -> pyarrow.RecordBatch:
"""
Return a dataframe with all current add actions.
Expand Down Expand Up @@ -476,4 +476,4 @@ def get_add_actions_df(self, flatten: bool = False) -> pyarrow.RecordBatch:
1 x=3/0-91820cbf-f698-45fb-886d-5d5f5669530b-0.p... 565 1970-01-20 08:40:08.071 True 3 1 0 6 6
2 x=1/0-91820cbf-f698-45fb-886d-5d5f5669530b-0.p... 565 1970-01-20 08:40:08.071 True 1 1 0 4 4
"""
return self._table.get_add_actions_df(flatten)
return self._table.get_add_actions(flatten)
2 changes: 1 addition & 1 deletion python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl RawDeltaTable {
Ok(())
}

pub fn get_add_actions_df(&self) -> PyResult<PyArrowType<RecordBatch>> {
pub fn get_add_actions(&self, flatten: bool) -> PyResult<PyArrowType<RecordBatch>> {
Ok(PyArrowType(
self._table
.get_state()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_table_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_history_partitioned_table_metadata():
def test_add_actions_table(flatten: bool):
table_path = "../rust/tests/data/delta-0.8.0-partitioned"
dt = DeltaTable(table_path)
actions_df = dt.get_add_actions_df(flatten)
actions_df = dt.get_add_actions(flatten)
# RecordBatch doesn't have a sort_by method yet
actions_df = pa.Table.from_batches([actions_df]).sort_by("path").to_batches()[0]

Expand Down
2 changes: 2 additions & 0 deletions rust/src/table_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ impl DeltaTableState {
Ok(actions)
}
}

#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
Expand Down

0 comments on commit 8b5bab9

Please sign in to comment.