Skip to content

Commit 72a788d

Browse files
authored
Extract RecordBatchExt & friends out of re_redap_tests (#12039)
* Extract `RecordBatchExt`, `SchemaExt` & `FieldsExt` out of `re_redap_tests` and into `re_arrow_util` instead * So that they can be used without having to depend on `re_redap_tests`, which is a guaranteed dependency cycle * Rename them to `RecordBatchTestExt`, `SchemaTestExt` & `FieldsTestExt` respectively * A) So they don't conflict with the other `RecordBatchExt` etc traits that we have * B) To communicate clearly that these traits will not shy away from unwraps() and other shortcuts --- This is a pre-requisite for the upcoming RRD footer PRs. * Sibling: rerun-io/dataplatform#2090
1 parent 39522a6 commit 72a788d

File tree

15 files changed

+31
-25
lines changed

15 files changed

+31
-25
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8423,6 +8423,7 @@ dependencies = [
84238423
"anyhow",
84248424
"arrow",
84258425
"comfy-table",
8426+
"datafusion",
84268427
"half",
84278428
"insta",
84288429
"itertools 0.14.0",
@@ -9401,7 +9402,6 @@ dependencies = [
94019402
"anyhow",
94029403
"arrow",
94039404
"chrono",
9404-
"datafusion",
94059405
"futures",
94069406
"insta",
94079407
"itertools 0.14.0",

crates/store/re_redap_tests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ re_types.workspace = true
3636

3737
anyhow.workspace = true
3838
arrow.workspace = true
39-
datafusion.workspace = true
4039
futures.workspace = true
4140
insta = { workspace = true, features = ["filters"] }
4241
itertools.workspace = true

crates/store/re_redap_tests/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ mod tests;
2121
mod utils;
2222

2323
pub use self::utils::{
24-
arrow::{FieldsExt, RecordBatchExt, SchemaExt},
2524
path::TempPath,
2625
rerun::{
2726
TuidPrefix, create_minimal_binary_recording_in, create_nasty_recording,
@@ -32,3 +31,5 @@ pub use self::utils::{
3231
};
3332

3433
pub use self::tests::*;
34+
35+
pub use ::re_arrow_util::{FieldsTestExt, RecordBatchTestExt, SchemaTestExt}; // convenience

crates/store/re_redap_tests/src/tests/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use re_protos::{
1818
use re_types_core::AsComponents;
1919

2020
use crate::{
21-
RecordBatchExt as _, TempPath, TuidPrefix, create_nasty_recording,
21+
RecordBatchTestExt as _, TempPath, TuidPrefix, create_nasty_recording,
2222
create_recording_with_embeddings, create_recording_with_properties,
2323
create_recording_with_scalars, create_recording_with_text, create_simple_recording,
2424
};

crates/store/re_redap_tests/src/tests/create_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::SchemaExt as _;
1+
use crate::SchemaTestExt as _;
22
use arrow::datatypes::{DataType, Field, Schema};
33
use re_protos::cloud::v1alpha1::GetTableSchemaRequest;
44
use re_protos::cloud::v1alpha1::ext::{

crates/store/re_redap_tests/src/tests/dataset_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use re_protos::{
44
};
55

66
use super::common::{DataSourcesDefinition, LayerDefinition, RerunCloudServiceExt as _};
7-
use crate::SchemaExt as _;
7+
use crate::SchemaTestExt as _;
88

99
pub async fn simple_dataset_schema(service: impl RerunCloudService) {
1010
let data_sources_def = DataSourcesDefinition::new_with_tuid_prefix(

crates/store/re_redap_tests/src/tests/entries_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use re_protos::cloud::v1alpha1::{
88
};
99

1010
use crate::tests::common::RerunCloudServiceExt as _;
11-
use crate::{RecordBatchExt as _, SchemaExt as _};
11+
use crate::{RecordBatchTestExt as _, SchemaTestExt as _};
1212

1313
/// We want to make sure that the "__entries" table is present and has the expected schema and data.
1414
pub async fn list_entries_table(service: impl RerunCloudService) {

crates/store/re_redap_tests/src/tests/fetch_chunks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use re_sdk::external::re_log_encoding::ToApplication as _;
1414
use re_tuid::Tuid;
1515
use re_types_core::Loggable as _;
1616

17-
use crate::RecordBatchExt as _;
17+
use crate::RecordBatchTestExt as _;
1818
use crate::tests::common::{
1919
DataSourcesDefinition, LayerDefinition, RerunCloudServiceExt as _, concat_record_batches,
2020
};

crates/store/re_redap_tests/src/tests/query_dataset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use re_protos::{
1111
use crate::tests::common::{
1212
DataSourcesDefinition, LayerDefinition, RerunCloudServiceExt as _, concat_record_batches,
1313
};
14-
use crate::{FieldsExt as _, RecordBatchExt as _};
14+
use crate::{FieldsTestExt as _, RecordBatchTestExt as _};
1515

1616
pub async fn query_empty_dataset(service: impl RerunCloudService) {
1717
let dataset_name = "dataset";

crates/store/re_redap_tests/src/tests/register_segment.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ use re_protos::{
1818
};
1919

2020
use super::common::{DataSourcesDefinition, LayerDefinition, RerunCloudServiceExt as _, prop};
21-
use crate::{FieldsExt as _, RecordBatchExt as _, SchemaExt as _, create_simple_recording_in};
21+
use crate::{
22+
FieldsTestExt as _, RecordBatchTestExt as _, SchemaTestExt as _, create_simple_recording_in,
23+
};
2224

2325
pub async fn register_and_scan_simple_dataset(service: impl RerunCloudService) {
2426
let data_sources_def = DataSourcesDefinition::new_with_tuid_prefix(

0 commit comments

Comments
 (0)