Skip to content

Commit c493cb3

Browse files
committed
Revert "amend struct PyDataFrameDisplayConfig remove max_cell_length"
This reverts commit f2dce7b.
1 parent f2dce7b commit c493cb3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/context.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ pub struct PyDataframeDisplayConfig {
8282
/// Minimum number of table rows to display (default: 20)
8383
#[pyo3(get, set)]
8484
pub min_table_rows: usize,
85+
/// Maximum length of a cell before it gets minimized (default: 25)
86+
#[pyo3(get, set)]
87+
pub max_cell_length: usize,
8588
/// Maximum number of rows to display in repr string output (default: 10)
8689
#[pyo3(get, set)]
8790
pub max_table_rows_in_repr: usize,
@@ -90,16 +93,18 @@ pub struct PyDataframeDisplayConfig {
9093
#[pymethods]
9194
impl PyDataframeDisplayConfig {
9295
#[new]
93-
#[pyo3(signature = (max_table_bytes=None, min_table_rows=None, max_table_rows_in_repr=None))]
96+
#[pyo3(signature = (max_table_bytes=None, min_table_rows=None, max_cell_length=None, max_table_rows_in_repr=None))]
9497
fn new(
9598
max_table_bytes: Option<usize>,
9699
min_table_rows: Option<usize>,
100+
max_cell_length: Option<usize>,
97101
max_table_rows_in_repr: Option<usize>,
98102
) -> Self {
99103
let default = Self::default();
100104
Self {
101105
max_table_bytes: max_table_bytes.unwrap_or(default.max_table_bytes),
102106
min_table_rows: min_table_rows.unwrap_or(default.min_table_rows),
107+
max_cell_length: max_cell_length.unwrap_or(default.max_cell_length),
103108
max_table_rows_in_repr: max_table_rows_in_repr
104109
.unwrap_or(default.max_table_rows_in_repr),
105110
}
@@ -111,6 +116,7 @@ impl Default for PyDataframeDisplayConfig {
111116
Self {
112117
max_table_bytes: 2 * 1024 * 1024, // 2 MB
113118
min_table_rows: 20,
119+
max_cell_length: 25,
114120
max_table_rows_in_repr: 10,
115121
}
116122
}
@@ -984,7 +990,6 @@ impl PySessionContext {
984990
#[allow(clippy::too_many_arguments)]
985991
#[pyo3(signature = (
986992
path,
987-
schema=None,
988993
table_partition_cols=vec![],
989994
parquet_pruning=true,
990995
file_extension=".parquet",

0 commit comments

Comments
 (0)