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

Client-side chunks 0: improved arrow chunk formatters #6437

Merged
merged 2 commits into from
May 31, 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
76 changes: 43 additions & 33 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1171,10 +1171,11 @@ dependencies = [

[[package]]
name = "comfy-table"
version = "7.1.0"
version = "7.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686"
checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7"
dependencies = [
"crossterm",
"strum",
"strum_macros",
"unicode-width",
Expand Down Expand Up @@ -1382,6 +1383,28 @@ dependencies = [
"cfg-if",
]

[[package]]
name = "crossterm"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
dependencies = [
"bitflags 2.4.1",
"crossterm_winapi",
"libc",
"parking_lot",
"winapi",
]

[[package]]
name = "crossterm_winapi"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
dependencies = [
"winapi",
]

[[package]]
name = "crunchy"
version = "0.2.2"
Expand Down Expand Up @@ -2625,9 +2648,9 @@ dependencies = [

[[package]]
name = "indoc"
version = "2.0.4"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"

[[package]]
name = "infer"
Expand Down Expand Up @@ -3127,9 +3150,9 @@ dependencies = [

[[package]]
name = "multimap"
version = "0.8.3"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03"

[[package]]
name = "naga"
Expand Down Expand Up @@ -3822,23 +3845,23 @@ dependencies = [

[[package]]
name = "prost"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a"
checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29"
dependencies = [
"bytes",
"prost-derive",
]

[[package]]
name = "prost-build"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2"
checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4"
dependencies = [
"bytes",
"heck 0.4.1",
"itertools 0.10.5",
"itertools 0.12.0",
"log",
"multimap",
"once_cell",
Expand All @@ -3849,27 +3872,26 @@ dependencies = [
"regex",
"syn 2.0.48",
"tempfile",
"which",
]

[[package]]
name = "prost-derive"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e"
checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools 0.10.5",
"itertools 0.12.0",
"proc-macro2",
"quote",
"syn 2.0.48",
]

[[package]]
name = "prost-types"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e"
checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
dependencies = [
"prost",
]
Expand Down Expand Up @@ -6199,18 +6221,18 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"

[[package]]
name = "strum"
version = "0.25.0"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
dependencies = [
"strum_macros",
]

[[package]]
name = "strum_macros"
version = "0.25.3"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
dependencies = [
"heck 0.4.1",
"proc-macro2",
Expand Down Expand Up @@ -7227,18 +7249,6 @@ dependencies = [
"web-sys",
]

[[package]]
name = "which"
version = "4.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
dependencies = [
"either",
"home",
"once_cell",
"rustix 0.38.24",
]

[[package]]
name = "widestring"
version = "1.0.2"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ similar-asserts = "1.4.2"
slotmap = { version = "1.0.6", features = ["serde"] }
smallvec = { version = "1.0", features = ["const_generics", "union"] }
static_assertions = "1.1"
strum = { version = "0.25", features = ["derive"] }
strum_macros = "0.25"
strum = { version = "0.26", features = ["derive"] }
strum_macros = "0.26"
sublime_fuzzy = "0.7"
syn = "2.0"
sysinfo = { version = "0.30.1", default-features = false }
Expand Down
15 changes: 9 additions & 6 deletions crates/re_data_store/src/store_format.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use arrow2::datatypes::Metadata;
use re_format::{format_bytes, format_uint};
use re_log_types::TimeInt;
use re_types_core::SizeBytes as _;
Expand Down Expand Up @@ -138,9 +139,10 @@ impl std::fmt::Display for IndexedBucket {
re_log::error_once!("couldn't display indexed bucket: {err}");
std::fmt::Error
})?;
re_format_arrow::format_table(
columns.columns(),
schema.fields.iter().map(|field| field.name.as_str()),
re_format_arrow::format_dataframe(
Metadata::default(),
&schema.fields,
columns.columns().iter().map(|array| &**array),
)
.fmt(f)?;

Expand Down Expand Up @@ -170,9 +172,10 @@ impl std::fmt::Display for StaticTable {
re_log::error_once!("couldn't display static table: {err}");
std::fmt::Error
})?;
re_format_arrow::format_table(
columns.columns(),
schema.fields.iter().map(|field| field.name.as_str()),
re_format_arrow::format_dataframe(
Metadata::default(),
&schema.fields,
columns.columns().iter().map(|array| &**array),
)
.fmt(f)?;

Expand Down
9 changes: 8 additions & 1 deletion crates/re_format_arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ all-features = true

[dependencies]
arrow2.workspace = true
comfy-table.workspace = true
re_tuid.workspace = true
re_types_core.workspace = true # tuid serialization

# native dependencies:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
comfy-table = { workspace = true, features = ["tty"] }

# web dependencies:
[target.'cfg(target_arch = "wasm32")'.dependencies]
comfy-table = { workspace = true }
Loading
Loading