Skip to content

Commit

Permalink
feat: Change default for maximum number of Series items printed to 10…
Browse files Browse the repository at this point in the history
… to match DataFrame (#14703)
  • Loading branch information
stinodego authored Feb 27, 2024
1 parent 60a3c3e commit 925f61a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
9 changes: 5 additions & 4 deletions crates/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ use num_traits::{Num, NumCast};

use crate::config::*;
use crate::prelude::*;
const LIMIT: usize = 25;

// Note: see https://github.com/pola-rs/polars/pull/13699 for the rationale
// behind choosing 10 as the default value for default number of rows displayed
const LIMIT: usize = 10;

#[derive(Copy, Clone)]
#[repr(u8)]
Expand Down Expand Up @@ -523,9 +526,7 @@ impl Display for DataFrame {
.as_deref()
.unwrap_or("")
.parse()
// Note: see https://github.com/pola-rs/polars/pull/13699 for
// the rationale behind choosing 10 as the default value
.map_or(10, |n: i64| if n < 0 { height } else { n as usize });
.map_or(LIMIT, |n: i64| if n < 0 { height } else { n as usize });

let (n_first, n_last) = if self.width() > max_n_cols {
((max_n_cols + 1) / 2, max_n_cols / 2)
Expand Down
15 changes: 0 additions & 15 deletions py-polars/tests/unit/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,7 @@ def _environ() -> Iterator[None]:
2
3
4
5
6
7
8
9
10
11
12
88
89
90
91
92
93
94
95
96
97
Expand Down

0 comments on commit 925f61a

Please sign in to comment.