Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change default for maximum number of Series items printed to 10 to match DataFrame #14703

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading