Skip to content

Commit

Permalink
chore(rust): Update comfy-table and memchr. (#5276)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls committed Oct 20, 2022
1 parent 88c850f commit 1799fad
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 98 deletions.
2 changes: 1 addition & 1 deletion polars/polars-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ base64 = { version = "0.13", optional = true }
bitflags.workspace = true
chrono = { version = "0.4", optional = true }
chrono-tz = { version = "0.6", optional = true }
comfy-table = { version = "5.0", optional = true }
comfy-table = { version = "6.1.1", optional = true }
hashbrown.workspace = true
hex = { version = "0.4", optional = true }
indexmap = { version = "1", features = ["std"] }
Expand Down
10 changes: 4 additions & 6 deletions polars/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ impl Display for DataFrame {
let row = self.columns.iter().map(|s| s.str_value(i)).collect();
rows.push(prepare_row(row, n_first, n_last, str_truncate));
}
for row in rows {
table.add_row(row);
}
table.add_rows(rows);
} else {
for i in 0..self.height() {
if self.width() > 0 {
Expand Down Expand Up @@ -497,13 +495,13 @@ impl Display for DataFrame {

// if tbl_width is explicitly set, use it
if let Some(w) = tbl_width {
table.set_table_width(w);
table.set_width(w);
}

// if no tbl_width (its not-tty && it is not explicitly set), then set default.
// this is needed to support non-tty applications
if !table.is_tty() && table.get_table_width().is_none() {
table.set_table_width(100);
if !table.is_tty() && table.width().is_none() {
table.set_width(100);
}

// set alignment of cells, if defined
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dirs = "4.0"
flate2 = { version = "1", optional = true, default-features = false }
lexical = { version = "6", optional = true, default-features = false, features = ["std", "parse-floats", "parse-integers"] }
lexical-core = { version = "0.8", optional = true }
memchr = "2.4"
memchr = "2.5"
memmap = { package = "memmap2", version = "0.5.2", optional = true }
num.workspace = true
once_cell = "1"
Expand Down

0 comments on commit 1799fad

Please sign in to comment.