Skip to content

Commit

Permalink
Correct minimum value for POLARS_FMT_MAX_ROWS if lower than 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls authored and ritchie46 committed Nov 11, 2021
1 parent 350f41e commit f3b7442
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions polars/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,17 @@ impl Display for DataFrame {
.parse()
.unwrap_or(8);
#[cfg(any(feature = "plain_fmt", feature = "pretty_fmt"))]
let max_n_rows = std::env::var("POLARS_FMT_MAX_ROWS")
.unwrap_or_else(|_| "8".to_string())
.parse()
.unwrap_or(8);

let max_n_rows = {
let max_n_rows = std::env::var("POLARS_FMT_MAX_ROWS")
.unwrap_or_else(|_| "8".to_string())
.parse()
.unwrap_or(8);
if max_n_rows < 2 {
2
} else {
max_n_rows
}
};
let (n_first, n_last) = if self.width() > max_n_cols {
((max_n_cols + 1) / 2, max_n_cols / 2)
} else {
Expand Down

0 comments on commit f3b7442

Please sign in to comment.