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

[deps] switch to comfy-table from prettytable #1126

Merged
merged 1 commit into from
Jul 21, 2021
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
186 changes: 88 additions & 98 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/datablocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ common-infallible = {path = "../infallible"}

# Crates.io dependencies
ahash = "0.7.4"
prettytable-rs = { version = "0.8.0"}
comfy-table = "4.0.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

12 changes: 5 additions & 7 deletions common/datablocks/src/data_block_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
//
// SPDX-License-Identifier: Apache-2.0.

use comfy_table::Cell;
use comfy_table::Table;
use common_exception::Result;
use prettytable::format;
use prettytable::Cell;
use prettytable::Row;
use prettytable::Table;

use crate::DataBlock;

Expand Down Expand Up @@ -68,7 +66,7 @@ pub fn assert_blocks_sorted_eq_with_name(test_name: &str, expect: Vec<&str>, blo
///! Convert a series of record batches into a table
fn create_table(results: &[DataBlock]) -> Result<Table> {
let mut table = Table::new();
table.set_format(*format::consts::FORMAT_NO_LINESEP_WITH_TITLE);
table.load_preset("||--+-++| ++++++");

if results.is_empty() {
return Ok(table);
Expand All @@ -80,7 +78,7 @@ fn create_table(results: &[DataBlock]) -> Result<Table> {
for field in schema.fields() {
header.push(Cell::new(field.name()));
}
table.set_titles(Row::new(header));
table.set_header(header);

for batch in results {
for row in 0..batch.num_rows() {
Expand All @@ -90,7 +88,7 @@ fn create_table(results: &[DataBlock]) -> Result<Table> {
let str = format!("{}", series.try_get(row)?);
cells.push(Cell::new(&str));
}
table.add_row(Row::new(cells));
table.add_row(cells);
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/datavalues/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ unsafe_unwrap = "^0.1.0"
ordered-float = "2.7"
serde = { version = "1.0", features = ["derive"] }
ahash = "0.7.4"
prettytable-rs = { version = "0.8.0"}
comfy-table = "4.0.1"


[dev-dependencies]
Expand Down
Loading