From 31a166f48e89626184e8800ab749b123154c6b31 Mon Sep 17 00:00:00 2001 From: Zeljko Mihaljcic <7150613+zehiko@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:12:18 +0100 Subject: [PATCH] gRPC spec update: Add support for selecting specific columns while listing recordings metadata (#8049) Providing a selection of columns is optional, but if provided, it's expected that the remote store will only project and return those columns. --- .../re_protos/proto/rerun/v0/remote_store.proto | 11 ++++++++++- .../re_protos/src/v0/rerun.remote_store.v0.rs | 15 +++++++++++++-- rerun_py/src/remote.rs | 4 +++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/crates/store/re_protos/proto/rerun/v0/remote_store.proto b/crates/store/re_protos/proto/rerun/v0/remote_store.proto index ac69c8124574..801bc6c8f340 100644 --- a/crates/store/re_protos/proto/rerun/v0/remote_store.proto +++ b/crates/store/re_protos/proto/rerun/v0/remote_store.proto @@ -106,7 +106,16 @@ enum EncoderVersion { // ----------------- ListRecordings ----------------- -message ListRecordingsRequest {} +message ListRecordingsRequest { + // define which columns should be returned / projected + // we define a separate message to make it optional. + // If not provided, all columns should be returned + ColumnProjection column_projection = 1; +} + +message ColumnProjection { + repeated string columns = 1; +} message ListRecordingsResponse { repeated RecordingMetadata recordings = 1; diff --git a/crates/store/re_protos/src/v0/rerun.remote_store.v0.rs b/crates/store/re_protos/src/v0/rerun.remote_store.v0.rs index 2ea5c426c441..7c76d42a2863 100644 --- a/crates/store/re_protos/src/v0/rerun.remote_store.v0.rs +++ b/crates/store/re_protos/src/v0/rerun.remote_store.v0.rs @@ -338,8 +338,19 @@ pub struct QueryResponse { #[prost(bytes = "vec", tag = "2")] pub payload: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ListRecordingsRequest {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListRecordingsRequest { + /// define which columns should be returned / projected + /// we define a separate message to make it optional. + /// If not provided, all columns should be returned + #[prost(message, optional, tag = "1")] + pub column_projection: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ColumnProjection { + #[prost(string, repeated, tag = "1")] + pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListRecordingsResponse { #[prost(message, repeated, tag = "1")] diff --git a/rerun_py/src/remote.rs b/rerun_py/src/remote.rs index e46498046ccb..ca71c68a6be8 100644 --- a/rerun_py/src/remote.rs +++ b/rerun_py/src/remote.rs @@ -54,7 +54,9 @@ impl PyConnection { /// List all recordings registered with the node. fn list_recordings(&mut self) -> PyResult> { self.runtime.block_on(async { - let request = ListRecordingsRequest {}; + let request = ListRecordingsRequest { + column_projection: None, + }; let resp = self .client