Skip to content

Commit

Permalink
Merge pull request #1323 from PsiACE/comfy-table
Browse files Browse the repository at this point in the history
[deps] all in comfy-table
  • Loading branch information
databend-bot authored Aug 6, 2021
2 parents dd03f12 + 36c5c61 commit 122deeb
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 117 deletions.
110 changes: 11 additions & 99 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions common/arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ simd = ["arrow/simd"]
# Workspace dependencies

# Github dependencies
arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", rev = "d545253" }
arrow-flight = { git="https://github.com/datafuse-extras/arrow2", rev = "d545253" }
arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", rev = "e92f47a" }
arrow-flight = { git="https://github.com/datafuse-extras/arrow2", rev = "e92f47a" }
parquet = {package = "parquet2", git = "https://github.com/datafuse-extras/parquet2", rev = "05854c0"}
# Crates.io dependencies

Expand Down
2 changes: 1 addition & 1 deletion common/datablocks/src/data_block_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::DataBlock;

///! Create a visual representation of record batches
pub fn pretty_format_blocks(results: &[DataBlock]) -> Result<String> {
Ok(create_table(results)?.to_string())
Ok(create_table(results)?.trim_fmt())
}

pub fn assert_blocks_eq(expect: Vec<&str>, blocks: &[DataBlock]) {
Expand Down
2 changes: 1 addition & 1 deletion common/datavalues/src/series/series_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::Series;

///! Create a visual representation of record batches
pub fn pretty_format_series(results: &[Series]) -> Result<String> {
Ok(create_table(results)?.to_string())
Ok(create_table(results)?.trim_fmt())
}

pub fn assert_series_eq(expect: Vec<&str>, series: &[Series]) {
Expand Down
2 changes: 1 addition & 1 deletion fusecli/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ path = "src/bin/datafuse-cli.rs"
# Crates.io dependencies
clap = "2.33.3"
colored = "2.0.0"
comfy-table = "4.0.1"
dirs = "3.0.2"
dyn-clone = "1.0.4"
flate2 = "1.0.20"
indicatif = "0.16.2"
prettytable-rs = "0.8.0"
run_script = "^0.8.0"
rustyline = "8.2.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
25 changes: 13 additions & 12 deletions fusecli/cli/src/cmds/packages/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use std::fs;

use colored::Colorize;
use prettytable::Cell;
use prettytable::Row;
use prettytable::Table;
use comfy_table::Cell;
use comfy_table::CellAlignment;
use comfy_table::Color;
use comfy_table::Table;

use crate::cmds::Config;
use crate::cmds::Status;
Expand Down Expand Up @@ -35,12 +35,13 @@ impl ListCommand {
}

let mut table = Table::new();
table.load_preset("||--+-++| ++++++");
// Title.
table.add_row(Row::new(vec![
table.set_header(vec![
Cell::new("Version"),
Cell::new("Path"),
Cell::new("Current"),
]));
]);
for path in paths {
let path = path.unwrap();
let version = path
Expand All @@ -51,16 +52,16 @@ impl ListCommand {
.into_owned();
let mut row = vec![];
row.push(Cell::new(version.as_str()));
row.push(Cell::new(format!("{}", path.path().display(),).as_str()));
row.push(Cell::new(format!("{}", path.path().display(),)));

let mut current_marker = "".to_string();
let mut current_marker = Cell::new("");
if current == version {
current_marker = format!("{}", "✅ ".blue());
current_marker = Cell::new("☑").fg(Color::Green);
}
row.push(Cell::new(current_marker.as_str()));
table.add_row(Row::new(row));
row.push(current_marker.set_alignment(CellAlignment::Center));
table.add_row(row);
}
table.print(writer).unwrap();
writer.writeln(&table.trim_fmt());

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion fusestore/store/src/tests/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub fn next_port() -> u32 {
19000u32 + (*Seq::default() as u32)
}

#[allow(dead_code)]
pub struct StoreTestContext {
#[allow(dead_code)]
meta_temp_dir: TempDir,
local_fs_tmp_dir: TempDir,
pub config: configs::Config,
Expand Down

0 comments on commit 122deeb

Please sign in to comment.