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

re_query: remove polars and general dependency/features clean up #4871

Merged
merged 4 commits into from
Jan 19, 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
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/re_data_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ polars-ops = { workspace = true, optional = true, features = [


[dev-dependencies]
re_log_types = { workspace = true, features = ["testing"] }
re_types = { workspace = true, features = ["datagen", "testing"] }

anyhow.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/re_entity_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ web-time.workspace = true

[dev-dependencies]
re_log_encoding = { workspace = true, features = ["decoder", "encoder"] }
re_log_types = { workspace = true, features = ["testing"] }
re_types = { workspace = true, features = ["datagen"] }

anyhow.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/re_log_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ serde = [
"re_types_core/serde",
]

testing = []

[dependencies]

# Rerun
Expand Down
1 change: 0 additions & 1 deletion crates/re_log_types/src/data_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,6 @@ impl DataTable {

/// Crafts a simple but interesting [`DataTable`].
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "testing")]
impl DataTable {
pub fn example(timeless: bool) -> DataTable {
use crate::{
Expand Down
1 change: 0 additions & 1 deletion crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub mod arrow_msg;
mod data_cell;
mod data_row;
mod data_table;
#[cfg(feature = "testing")]
pub mod example_components;
pub mod hash;
mod num_instances;
Expand Down
18 changes: 0 additions & 18 deletions crates/re_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ all-features = true
[features]
default = []

## Polars support
polars = ["dep:polars-core", "re_data_store/polars"]

testing = ["re_log_types/testing"]

[dependencies]
# Rerun dependencies:
re_data_store.workspace = true
Expand All @@ -42,26 +37,13 @@ itertools = { workspace = true }
smallvec.workspace = true
thiserror.workspace = true

# Optional dependencies:
polars-core = { workspace = true, optional = true, features = [
"dtype-date",
"dtype-time",
"dtype-struct",
] }


[dev-dependencies]
re_types = { workspace = true, features = ["datagen"] }

criterion.workspace = true
itertools = { workspace = true }
mimalloc.workspace = true
polars-core = { workspace = true, features = [
"dtype-date",
"dtype-time",
"dtype-struct",
"fmt",
] }
rand = { workspace = true, features = ["std", "std_rng"] }

[lib]
Expand Down
14 changes: 14 additions & 0 deletions crates/re_query/src/archetype_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ pub struct ComponentWithInstances {
pub(crate) values: DataCell,
}

impl std::fmt::Display for ComponentWithInstances {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let table = arrow::format_table(
[
self.instance_keys.as_arrow_ref(),
self.values.as_arrow_ref(),
],
["InstanceKey", self.values.component_name().as_ref()],
);

f.write_fmt(format_args!("ComponentWithInstances:\n{table}"))
}
}

impl ComponentWithInstances {
/// Name of the [`Component`]
#[inline]
Expand Down
216 changes: 0 additions & 216 deletions crates/re_query/src/dataframe_util.rs

This file was deleted.

15 changes: 1 addition & 14 deletions crates/re_query/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
//! Provide query-centric access to the [`re_data_store`].
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!

// TODO(jleibs) better crate documentation.

mod archetype_view;
mod query;
mod range;
mod util;

#[cfg(feature = "polars")]
pub mod dataframe_util;

pub use self::archetype_view::{ArchetypeView, ComponentWithInstances};
pub use self::query::{get_component_with_instances, query_archetype};
pub use self::range::range_archetype;
pub use self::util::query_archetype_with_history;

// Used for doc-tests
#[cfg(feature = "testing")]
#[doc(hidden)]
pub use self::query::__populate_example_store;

#[derive(Debug, Clone, Copy)]
Expand Down Expand Up @@ -63,10 +54,6 @@ pub enum QueryError {
#[error("Error converting arrow data: {0}")]
ArrowError(#[from] arrow2::error::Error),

#[cfg(feature = "polars")]
#[error("Error from within Polars")]
PolarsError(#[from] polars_core::prelude::PolarsError),

#[error("Not implemented")]
NotImplemented,
}
Expand Down
Loading
Loading