diff --git a/pixi.toml b/pixi.toml index 0e69a9f6c..0268cc812 100644 --- a/pixi.toml +++ b/pixi.toml @@ -101,16 +101,10 @@ docs-rebuild = { depends_on = ["docs-clean", "docs-build"] } docs-serve = { cmd = "python -m http.server --directory docs/build/html 8000" } docs-publish = { cmd = "./sync_docs.sh", depends_on = ["docs-rebuild"], cwd = "docs" } -# Note: the `--no-verify` flag below for `vegafusion-core` is due to this cargo publish error: -# -# Source directory was modified by build.rs during cargo publish. Build scripts should not modify anything outside of OUT_DIR. -# -# We currently write the prost files to src (mostly to make it easier for IDEs to locate them). This should be safe in our case -# as these aren't modified unless the .proto files change, but we should revisit where these files are written in the future. [tasks.publish-rs] cmd = """ cargo publish -p vegafusion-common && -cargo publish -p vegafusion-core --no-verify && +cargo publish -p vegafusion-core && cargo publish -p vegafusion-dataframe && cargo publish -p vegafusion-datafusion-udfs && cargo publish -p vegafusion-sql && diff --git a/vegafusion-common/src/data/table.rs b/vegafusion-common/src/data/table.rs index 223dbb4d1..54a49a5f4 100644 --- a/vegafusion-common/src/data/table.rs +++ b/vegafusion-common/src/data/table.rs @@ -8,7 +8,6 @@ use arrow::{ ipc::{reader::StreamReader, writer::StreamWriter}, record_batch::RecordBatch, }; -use std::hash::BuildHasher; use crate::{ data::{ORDER_COL, ORDER_COL_DTYPE}, @@ -435,9 +434,7 @@ impl VegaFusionTable { } pub fn get_hash(&self) -> u64 { - let mut hasher = RandomState::with_seed(123).build_hasher(); - self.hash(&mut hasher); - hasher.finish() + RandomState::with_seed(123).hash_one(self) } } diff --git a/vegafusion-core/build.rs b/vegafusion-core/build.rs index 659485cb5..645af226c 100644 --- a/vegafusion-core/build.rs +++ b/vegafusion-core/build.rs @@ -6,9 +6,6 @@ fn main() { std::env::set_var("PROTOC", protobuf_src::protoc()); let mut prost_config = prost_build::Config::new(); - let outdir = concat!(env!("CARGO_MANIFEST_DIR"), "/src/proto/prost_gen"); - println!("outdir: {outdir}"); - let prost_config = prost_config.out_dir(outdir); prost_config .protoc_arg("--experimental_allow_proto3_optional") @@ -32,9 +29,6 @@ fn main() { #[cfg(feature = "tonic_support")] fn gen_tonic() { let builder = tonic_build::configure(); - let outdir = concat!(env!("CARGO_MANIFEST_DIR"), "/src/proto/tonic_gen"); - println!("outdir: {outdir}"); - let builder = builder.out_dir(outdir); let mut config = prost_build::Config::new(); config.protoc_arg("--experimental_allow_proto3_optional"); diff --git a/vegafusion-core/src/chart_state.rs b/vegafusion-core/src/chart_state.rs index 2cbf08b21..141d51826 100644 --- a/vegafusion-core/src/chart_state.rs +++ b/vegafusion-core/src/chart_state.rs @@ -82,7 +82,7 @@ impl ChartState { plan.comm_plan .server_to_client .iter() - .map(|scoped_var| task_graph_mapping.get(scoped_var).unwrap().clone()) + .map(|scoped_var| *task_graph_mapping.get(scoped_var).unwrap()) .collect(), ); @@ -91,7 +91,7 @@ impl ChartState { .comm_plan .server_to_client .iter() - .map(|var| task_graph_mapping.get(var).unwrap().clone()) + .map(|var| *task_graph_mapping.get(var).unwrap()) .collect(); let response_task_values = runtime @@ -144,11 +144,10 @@ impl ChartState { ExportUpdateNamespace::Data => Variable::new_data(&export_update.name), }; let scoped_var: ScopedVariable = (var, export_update.scope.clone()); - let node_value_index = self + let node_value_index = *self .task_graph_mapping .get(&scoped_var) - .with_context(|| format!("No task graph node found for {scoped_var:?}"))? - .clone(); + .with_context(|| format!("No task graph node found for {scoped_var:?}"))?; let value = match export_update.namespace { ExportUpdateNamespace::Signal => { diff --git a/vegafusion-core/src/data/dataset.rs b/vegafusion-core/src/data/dataset.rs index 691b10cf8..a29ed1aa5 100644 --- a/vegafusion-core/src/data/dataset.rs +++ b/vegafusion-core/src/data/dataset.rs @@ -25,7 +25,7 @@ impl VegaFusionDataset { pub fn from_table_ipc_bytes(ipc_bytes: &[u8]) -> Result { // Hash ipc bytes - let hash = ahash::RandomState::with_seed(123).hash_one(&ipc_bytes); + let hash = ahash::RandomState::with_seed(123).hash_one(ipc_bytes); let table = VegaFusionTable::from_ipc_bytes(ipc_bytes)?; Ok(Self::Table { table, hash }) } diff --git a/vegafusion-core/src/expression/parser.rs b/vegafusion-core/src/expression/parser.rs index 5af6f6f4c..7aecafbd1 100644 --- a/vegafusion-core/src/expression/parser.rs +++ b/vegafusion-core/src/expression/parser.rs @@ -201,7 +201,7 @@ pub fn parse_unary( let rhs = perform_parse(tokens, unary_bp, full_expr)?; let new_span = Span { start: start as i32, - end: rhs.span.clone().unwrap().end, + end: rhs.span.unwrap().end, }; let expr = Expr::from(UnaryExpression::new(&op, rhs)); Ok(Expression::new(expr, Some(new_span))) @@ -229,7 +229,7 @@ pub fn parse_binary( // Update lhs let new_span = Span { start: start as i32, - end: rhs.span.clone().unwrap().end, + end: rhs.span.unwrap().end, }; let expr = Expr::from(BinaryExpression::new(lhs.clone(), &op, rhs)); Ok(Expression::new(expr, Some(new_span))) @@ -259,7 +259,7 @@ pub fn parse_logical( // Update lhs let new_span = Span { start: start as i32, - end: rhs.span.clone().unwrap().end, + end: rhs.span.unwrap().end, }; let expr = Expr::from(LogicalExpression::new(lhs.clone(), &op, rhs)); Ok(Expression::new(expr, Some(new_span))) @@ -375,7 +375,7 @@ pub fn parse_static_member( // Update span let new_span = Span { start: start as i32, - end: property.span.clone().unwrap().end, + end: property.span.unwrap().end, }; let expr = match MemberExpression::new_static(lhs.clone(), property) { @@ -427,7 +427,7 @@ pub fn parse_ternary( // Update span let new_span = Span { start: start as i32, - end: alternate.span.clone().unwrap().end, + end: alternate.span.unwrap().end, }; let expr = Expr::from(ConditionalExpression::new( diff --git a/vegafusion-core/src/proto/gen.rs b/vegafusion-core/src/proto/gen.rs new file mode 100644 index 000000000..f4c6d0314 --- /dev/null +++ b/vegafusion-core/src/proto/gen.rs @@ -0,0 +1,24 @@ +// Create separate modules for each proto component +pub mod errors { + include!(concat!(env!("OUT_DIR"), "/errors.rs")); +} + +pub mod expression { + include!(concat!(env!("OUT_DIR"), "/expression.rs")); +} + +pub mod pretransform { + include!(concat!(env!("OUT_DIR"), "/pretransform.rs")); +} + +pub mod services { + include!(concat!(env!("OUT_DIR"), "/services.rs")); +} + +pub mod tasks { + include!(concat!(env!("OUT_DIR"), "/tasks.rs")); +} + +pub mod transforms { + include!(concat!(env!("OUT_DIR"), "/transforms.rs")); +} diff --git a/vegafusion-core/src/proto/mod.rs b/vegafusion-core/src/proto/mod.rs index 399ccad0d..50e93098c 100644 --- a/vegafusion-core/src/proto/mod.rs +++ b/vegafusion-core/src/proto/mod.rs @@ -1,9 +1 @@ -#[cfg(not(feature = "tonic_support"))] -pub mod prost_gen; -#[cfg(not(feature = "tonic_support"))] -pub use prost_gen as gen; - -#[cfg(feature = "tonic_support")] -pub mod tonic_gen; -#[cfg(feature = "tonic_support")] -pub use tonic_gen as gen; +pub mod gen; diff --git a/vegafusion-core/src/proto/prost_gen/errors.rs b/vegafusion-core/src/proto/prost_gen/errors.rs deleted file mode 100644 index cd484ee8f..000000000 --- a/vegafusion-core/src/proto/prost_gen/errors.rs +++ /dev/null @@ -1,19 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueError { - #[prost(string, tag = "1")] - pub msg: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Error { - #[prost(oneof = "error::Errorkind", tags = "1")] - pub errorkind: ::core::option::Option, -} -/// Nested message and enum types in `Error`. -pub mod error { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Errorkind { - #[prost(message, tag = "1")] - Error(super::TaskGraphValueError), - } -} diff --git a/vegafusion-core/src/proto/prost_gen/expression.rs b/vegafusion-core/src/proto/prost_gen/expression.rs deleted file mode 100644 index fbfc6ba32..000000000 --- a/vegafusion-core/src/proto/prost_gen/expression.rs +++ /dev/null @@ -1,284 +0,0 @@ -// This file is @generated by prost-build. -/// ESTree-style AST nodes -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Span { - #[prost(int32, tag = "1")] - pub start: i32, - #[prost(int32, tag = "2")] - pub end: i32, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Literal { - #[prost(string, tag = "1")] - pub raw: ::prost::alloc::string::String, - #[prost(oneof = "literal::Value", tags = "2, 3, 4, 5")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `Literal`. -pub mod literal { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - #[prost(string, tag = "2")] - String(::prost::alloc::string::String), - #[prost(bool, tag = "3")] - Boolean(bool), - #[prost(double, tag = "4")] - Number(f64), - #[prost(bool, tag = "5")] - Null(bool), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifierAbc { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Identifier { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnaryExpression { - #[prost(enumeration = "UnaryOperator", tag = "1")] - pub operator: i32, - #[prost(bool, tag = "2")] - pub prefix: bool, - #[prost(message, optional, boxed, tag = "3")] - pub argument: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LogicalExpression { - #[prost(message, optional, boxed, tag = "1")] - pub left: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(enumeration = "LogicalOperator", tag = "2")] - pub operator: i32, - #[prost(message, optional, boxed, tag = "3")] - pub right: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BinaryExpression { - #[prost(message, optional, boxed, tag = "1")] - pub left: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(enumeration = "BinaryOperator", tag = "2")] - pub operator: i32, - #[prost(message, optional, boxed, tag = "3")] - pub right: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConditionalExpression { - #[prost(message, optional, boxed, tag = "1")] - pub test: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "2")] - pub consequent: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "3")] - pub alternate: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MemberExpression { - #[prost(message, optional, boxed, tag = "1")] - pub object: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "2")] - pub property: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(bool, tag = "3")] - pub computed: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArrayExpression { - #[prost(message, repeated, tag = "1")] - pub elements: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CallExpression { - #[prost(string, tag = "1")] - pub callee: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub arguments: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Property { - #[prost(message, optional, tag = "3")] - pub value: ::core::option::Option, - #[prost(string, tag = "4")] - pub kind: ::prost::alloc::string::String, - #[prost(oneof = "property::Key", tags = "1, 2")] - pub key: ::core::option::Option, -} -/// Nested message and enum types in `Property`. -pub mod property { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Key { - #[prost(message, tag = "1")] - Literal(super::Literal), - #[prost(message, tag = "2")] - Identifier(super::Identifier), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ObjectExpression { - #[prost(message, repeated, tag = "1")] - pub properties: ::prost::alloc::vec::Vec, -} -/// Top-level expression -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Expression { - #[prost(message, optional, tag = "11")] - pub span: ::core::option::Option, - #[prost(oneof = "expression::Expr", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")] - pub expr: ::core::option::Option, -} -/// Nested message and enum types in `Expression`. -pub mod expression { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Expr { - #[prost(message, tag = "1")] - Identifier(super::Identifier), - #[prost(message, tag = "2")] - Literal(super::Literal), - #[prost(message, tag = "3")] - Binary(::prost::alloc::boxed::Box), - #[prost(message, tag = "4")] - Logical(::prost::alloc::boxed::Box), - #[prost(message, tag = "5")] - Unary(::prost::alloc::boxed::Box), - #[prost(message, tag = "6")] - Conditional(::prost::alloc::boxed::Box), - #[prost(message, tag = "7")] - Call(super::CallExpression), - #[prost(message, tag = "8")] - Array(super::ArrayExpression), - #[prost(message, tag = "9")] - Object(super::ObjectExpression), - #[prost(message, tag = "10")] - Member(::prost::alloc::boxed::Box), - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum UnaryOperator { - Pos = 0, - Neg = 1, - Not = 2, -} -impl UnaryOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Pos => "Pos", - Self::Neg => "Neg", - Self::Not => "Not", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Pos" => Some(Self::Pos), - "Neg" => Some(Self::Neg), - "Not" => Some(Self::Not), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LogicalOperator { - Or = 0, - And = 1, -} -impl LogicalOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Or => "Or", - Self::And => "And", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Or" => Some(Self::Or), - "And" => Some(Self::And), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum BinaryOperator { - Equals = 0, - NotEquals = 1, - StrictEquals = 2, - NotStrictEquals = 3, - LessThan = 4, - LessThanEqual = 5, - GreaterThan = 6, - GreaterThanEqual = 7, - Plus = 8, - Minus = 9, - Mult = 10, - Div = 11, - Mod = 12, - BitwiseAnd = 13, - BitwiseOr = 14, - BitwiseXor = 15, - BitwiseShiftLeft = 16, - BitwiseShiftRight = 17, -} -impl BinaryOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Equals => "Equals", - Self::NotEquals => "NotEquals", - Self::StrictEquals => "StrictEquals", - Self::NotStrictEquals => "NotStrictEquals", - Self::LessThan => "LessThan", - Self::LessThanEqual => "LessThanEqual", - Self::GreaterThan => "GreaterThan", - Self::GreaterThanEqual => "GreaterThanEqual", - Self::Plus => "Plus", - Self::Minus => "Minus", - Self::Mult => "Mult", - Self::Div => "Div", - Self::Mod => "Mod", - Self::BitwiseAnd => "BitwiseAnd", - Self::BitwiseOr => "BitwiseOr", - Self::BitwiseXor => "BitwiseXor", - Self::BitwiseShiftLeft => "BitwiseShiftLeft", - Self::BitwiseShiftRight => "BitwiseShiftRight", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Equals" => Some(Self::Equals), - "NotEquals" => Some(Self::NotEquals), - "StrictEquals" => Some(Self::StrictEquals), - "NotStrictEquals" => Some(Self::NotStrictEquals), - "LessThan" => Some(Self::LessThan), - "LessThanEqual" => Some(Self::LessThanEqual), - "GreaterThan" => Some(Self::GreaterThan), - "GreaterThanEqual" => Some(Self::GreaterThanEqual), - "Plus" => Some(Self::Plus), - "Minus" => Some(Self::Minus), - "Mult" => Some(Self::Mult), - "Div" => Some(Self::Div), - "Mod" => Some(Self::Mod), - "BitwiseAnd" => Some(Self::BitwiseAnd), - "BitwiseOr" => Some(Self::BitwiseOr), - "BitwiseXor" => Some(Self::BitwiseXor), - "BitwiseShiftLeft" => Some(Self::BitwiseShiftLeft), - "BitwiseShiftRight" => Some(Self::BitwiseShiftRight), - _ => None, - } - } -} diff --git a/vegafusion-core/src/proto/prost_gen/mod.rs b/vegafusion-core/src/proto/prost_gen/mod.rs deleted file mode 100644 index e9f0fc872..000000000 --- a/vegafusion-core/src/proto/prost_gen/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod expression; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod transforms; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod tasks; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod errors; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod pretransform; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod services; diff --git a/vegafusion-core/src/proto/prost_gen/pretransform.rs b/vegafusion-core/src/proto/prost_gen/pretransform.rs deleted file mode 100644 index f684c5978..000000000 --- a/vegafusion-core/src/proto/prost_gen/pretransform.rs +++ /dev/null @@ -1,175 +0,0 @@ -// This file is @generated by prost-build. -/// / Pre transform spec messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecOpts { - #[prost(uint32, optional, tag = "1")] - pub row_limit: ::core::option::Option, - #[prost(bool, tag = "2")] - pub preserve_interactivity: bool, - #[prost(message, repeated, tag = "3")] - pub keep_variables: ::prost::alloc::vec::Vec, - #[prost(string, tag = "4")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "5")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub opts: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecResponse { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecWarning { - #[prost(oneof = "pre_transform_spec_warning::WarningType", tags = "1, 2, 3, 4")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformSpecWarning`. -pub mod pre_transform_spec_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - RowLimit(super::PreTransformRowLimitWarning), - #[prost(message, tag = "2")] - BrokenInteractivity(super::PreTransformBrokenInteractivityWarning), - #[prost(message, tag = "3")] - Unsupported(super::PreTransformUnsupportedWarning), - #[prost(message, tag = "4")] - Planner(super::PlannerWarning), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformRowLimitWarning { - #[prost(message, repeated, tag = "1")] - pub datasets: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformBrokenInteractivityWarning { - #[prost(message, repeated, tag = "1")] - pub vars: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct PreTransformUnsupportedWarning {} -/// / Pre transform value messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformVariable { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesOpts { - #[prost(uint32, optional, tag = "1")] - pub row_limit: ::core::option::Option, - #[prost(string, tag = "2")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "3")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub variables: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub opts: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesResponse { - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesWarning { - #[prost(oneof = "pre_transform_values_warning::WarningType", tags = "1, 2")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformValuesWarning`. -pub mod pre_transform_values_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - RowLimit(super::PreTransformRowLimitWarning), - #[prost(message, tag = "2")] - Planner(super::PlannerWarning), - } -} -/// / Common pre-transform messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PlannerWarning { - #[prost(string, tag = "1")] - pub message: ::prost::alloc::string::String, -} -/// / Pre Transform Extract Datasets -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractDataset { - /// Result dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Result dataset scope - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes = "vec", tag = "3")] - pub table: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractOpts { - #[prost(string, tag = "1")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, - #[prost(bool, tag = "3")] - pub preserve_interactivity: bool, - #[prost(int32, tag = "4")] - pub extract_threshold: i32, - #[prost(message, repeated, tag = "5")] - pub keep_variables: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractWarning { - #[prost(oneof = "pre_transform_extract_warning::WarningType", tags = "1")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformExtractWarning`. -pub mod pre_transform_extract_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - Planner(super::PlannerWarning), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractResponse { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub datasets: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub opts: ::core::option::Option, -} diff --git a/vegafusion-core/src/proto/prost_gen/services.rs b/vegafusion-core/src/proto/prost_gen/services.rs deleted file mode 100644 index 310233641..000000000 --- a/vegafusion-core/src/proto/prost_gen/services.rs +++ /dev/null @@ -1,74 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRequest { - #[prost(oneof = "query_request::Request", tags = "1")] - pub request: ::core::option::Option, -} -/// Nested message and enum types in `QueryRequest`. -pub mod query_request { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Request { - #[prost(message, tag = "1")] - TaskGraphValues(super::super::tasks::TaskGraphValueRequest), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryResult { - #[prost(oneof = "query_result::Response", tags = "1, 2")] - pub response: ::core::option::Option, -} -/// Nested message and enum types in `QueryResult`. -pub mod query_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Response { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - TaskGraphValues(super::super::tasks::TaskGraphValueResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecResult { - #[prost(oneof = "pre_transform_spec_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformSpecResult`. -pub mod pre_transform_spec_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformSpecResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesResult { - #[prost(oneof = "pre_transform_values_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformValuesResult`. -pub mod pre_transform_values_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformValuesResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractResult { - #[prost(oneof = "pre_transform_extract_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformExtractResult`. -pub mod pre_transform_extract_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformExtractResponse), - } -} diff --git a/vegafusion-core/src/proto/prost_gen/tasks.rs b/vegafusion-core/src/proto/prost_gen/tasks.rs deleted file mode 100644 index 5d7f6f233..000000000 --- a/vegafusion-core/src/proto/prost_gen/tasks.rs +++ /dev/null @@ -1,295 +0,0 @@ -// This file is @generated by prost-build. -/// ## Task Value -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskValue { - #[prost(oneof = "task_value::Data", tags = "1, 2")] - pub data: ::core::option::Option, -} -/// Nested message and enum types in `TaskValue`. -pub mod task_value { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Data { - /// - /// Representation of scalar as single column, single row, record batch in Arrow IPC format - #[prost(bytes, tag = "1")] - Scalar(::prost::alloc::vec::Vec), - /// - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes, tag = "2")] - Table(::prost::alloc::vec::Vec), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Variable { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(enumeration = "VariableNamespace", tag = "2")] - pub namespace: i32, -} -/// ## Scan URL Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParseFieldSpec { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub datatype: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParseFieldSpecs { - #[prost(message, repeated, tag = "1")] - pub specs: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScanUrlFormat { - /// - /// The data format type. The currently supported data formats are json (the default), - /// csv (comma-separated values), tsv (tab-separated values), dsv (delimited text files), - /// and topojson. - #[prost(string, optional, tag = "1")] - pub r#type: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub property: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "5")] - pub header: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "6")] - pub delimiter: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "7")] - pub feature: ::core::option::Option<::prost::alloc::string::String>, - /// - /// JSON encoded string: - /// If set to auto, perform automatic type inference to determine the desired data types. - /// Alternatively, a parsing directive object can be provided for explicit data types. - /// Each property of the object corresponds to a field name, and the value to the desired data type - /// (one of "boolean", "date", "number" or "string"). For example, "parse": {"modified_on": "date"} - /// parses the modified_on field in each input record as a Date value. Specific date formats can - /// be provided (e.g., {"foo": "date:'%m%d%Y'"}), using the d3-time-format syntax. UTC date format - /// parsing is supported similarly (e.g., {"foo": "utc:'%m%d%Y'"}). - #[prost(oneof = "scan_url_format::Parse", tags = "2, 3")] - pub parse: ::core::option::Option, -} -/// Nested message and enum types in `ScanUrlFormat`. -pub mod scan_url_format { - /// - /// JSON encoded string: - /// If set to auto, perform automatic type inference to determine the desired data types. - /// Alternatively, a parsing directive object can be provided for explicit data types. - /// Each property of the object corresponds to a field name, and the value to the desired data type - /// (one of "boolean", "date", "number" or "string"). For example, "parse": {"modified_on": "date"} - /// parses the modified_on field in each input record as a Date value. Specific date formats can - /// be provided (e.g., {"foo": "date:'%m%d%Y'"}), using the d3-time-format syntax. UTC date format - /// parsing is supported similarly (e.g., {"foo": "utc:'%m%d%Y'"}). - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parse { - #[prost(string, tag = "2")] - String(::prost::alloc::string::String), - #[prost(message, tag = "3")] - Object(super::ParseFieldSpecs), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataUrlTask { - #[prost(int32, tag = "3")] - pub batch_size: i32, - #[prost(message, optional, tag = "4")] - pub format_type: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub pipeline: ::core::option::Option, - #[prost(oneof = "data_url_task::Url", tags = "1, 2")] - pub url: ::core::option::Option, -} -/// Nested message and enum types in `DataUrlTask`. -pub mod data_url_task { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Url { - #[prost(string, tag = "1")] - String(::prost::alloc::string::String), - #[prost(message, tag = "2")] - Expr(super::super::expression::Expression), - } -} -/// ## Inline values task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataValuesTask { - #[prost(bytes = "vec", tag = "1")] - pub values: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub format_type: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub pipeline: ::core::option::Option, -} -/// ## Transform Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataSourceTask { - #[prost(string, tag = "1")] - pub source: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pipeline: ::core::option::Option, -} -/// ## Signal Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignalTask { - #[prost(message, optional, tag = "2")] - pub expr: ::core::option::Option, -} -/// ## Timezone config -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TzConfig { - #[prost(string, tag = "1")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -/// ## Top-level Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Task { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub tz_config: ::core::option::Option, - #[prost(oneof = "task::TaskKind", tags = "3, 4, 5, 6, 7")] - pub task_kind: ::core::option::Option, -} -/// Nested message and enum types in `Task`. -pub mod task { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum TaskKind { - #[prost(message, tag = "3")] - Value(super::TaskValue), - #[prost(message, tag = "4")] - DataValues(super::DataValuesTask), - #[prost(message, tag = "5")] - DataUrl(super::DataUrlTask), - #[prost(message, tag = "6")] - DataSource(super::DataSourceTask), - #[prost(message, tag = "7")] - Signal(super::SignalTask), - } -} -/// ## Task Graph -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct IncomingEdge { - #[prost(uint32, tag = "1")] - pub source: u32, - #[prost(uint32, optional, tag = "2")] - pub output: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct OutgoingEdge { - #[prost(uint32, tag = "1")] - pub target: u32, - #[prost(bool, tag = "2")] - pub propagate: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskNode { - #[prost(message, optional, tag = "1")] - pub task: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub incoming: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub outgoing: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - pub id_fingerprint: u64, - #[prost(uint64, tag = "5")] - pub state_fingerprint: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraph { - #[prost(message, repeated, tag = "1")] - pub nodes: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct NodeValueIndex { - #[prost(uint32, tag = "1")] - pub node_index: u32, - #[prost(uint32, optional, tag = "2")] - pub output_index: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueRequest { - #[prost(message, optional, tag = "1")] - pub task_graph: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub indices: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub inline_datasets: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResponseTaskValue { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub value: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueResponse { - #[prost(message, repeated, tag = "1")] - pub response_values: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDatasetTable { - /// Inline dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes = "vec", tag = "2")] - pub table: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDatasetPlan { - /// Inline dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Serialized DataFusion plan in protobuf format - #[prost(bytes = "vec", tag = "2")] - pub plan: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDataset { - #[prost(oneof = "inline_dataset::Dataset", tags = "1, 2")] - pub dataset: ::core::option::Option, -} -/// Nested message and enum types in `InlineDataset`. -pub mod inline_dataset { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Dataset { - #[prost(message, tag = "1")] - Table(super::InlineDatasetTable), - #[prost(message, tag = "2")] - Plan(super::InlineDatasetPlan), - } -} -/// ## Variable -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VariableNamespace { - Signal = 0, - Data = 1, - Scale = 2, -} -impl VariableNamespace { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Signal => "Signal", - Self::Data => "Data", - Self::Scale => "Scale", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Signal" => Some(Self::Signal), - "Data" => Some(Self::Data), - "Scale" => Some(Self::Scale), - _ => None, - } - } -} diff --git a/vegafusion-core/src/proto/prost_gen/transforms.rs b/vegafusion-core/src/proto/prost_gen/transforms.rs deleted file mode 100644 index fa9f3283e..000000000 --- a/vegafusion-core/src/proto/prost_gen/transforms.rs +++ /dev/null @@ -1,606 +0,0 @@ -// This file is @generated by prost-build. -/// Filter -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Filter { - #[prost(message, optional, tag = "1")] - pub expr: ::core::option::Option, -} -/// Formula -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Formula { - #[prost(message, optional, tag = "1")] - pub expr: ::core::option::Option, - #[prost(string, tag = "2")] - pub r#as: ::prost::alloc::string::String, -} -/// Extent -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Extent { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, -} -/// Collect -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Collect { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "SortOrder", repeated, tag = "2")] - pub order: ::prost::alloc::vec::Vec, -} -/// Bin -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Bin { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub extent: ::core::option::Option, - #[prost(string, optional, tag = "3")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, - /// A value in the binned domain at which to anchor the bins The bin boundaries will be shifted, - /// if necessary, to ensure that a boundary aligns with the anchor value. - #[prost(double, optional, tag = "6")] - pub anchor: ::core::option::Option, - /// The maximum number of bins allowed - #[prost(message, optional, tag = "7")] - pub maxbins: ::core::option::Option, - /// The number base to use for automatic bin selection (e.g. base 10) - #[prost(double, tag = "8")] - pub base: f64, - /// An exact step size to use between bins. Overrides other options. - #[prost(double, optional, tag = "9")] - pub step: ::core::option::Option, - /// A list of allowable step sizes to choose from - #[prost(double, repeated, tag = "10")] - pub steps: ::prost::alloc::vec::Vec, - /// The value span over which to generate bin boundaries. Defaults to the exact extent of the data - #[prost(message, optional, tag = "11")] - pub span: ::core::option::Option, - /// A minimum distance between adjacent bins - #[prost(double, tag = "12")] - pub minstep: f64, - /// Scale factors indicating the allowed subdivisions. The defualt value is vec!\[5.0, 2.0\], - /// which indicates that for base 10 numbers, the method may consider dividing bin sizes by 5 and/or 2. - #[prost(double, repeated, tag = "13")] - pub divide: ::prost::alloc::vec::Vec, - /// If true, attempt to make the bin boundaries use human-friendly boundaries - /// (e.g. whole numbers, multiples of 10, etc.) - #[prost(bool, tag = "14")] - pub nice: bool, -} -/// Aggregate -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Aggregate { - #[prost(string, repeated, tag = "1")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "3")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "AggregateOp", repeated, tag = "4")] - pub ops: ::prost::alloc::vec::Vec, -} -/// JoinAggregate -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct JoinAggregate { - #[prost(string, repeated, tag = "1")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "AggregateOp", repeated, tag = "3")] - pub ops: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// TimeUnit -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimeUnit { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(enumeration = "TimeUnitUnit", repeated, tag = "2")] - pub units: ::prost::alloc::vec::Vec, - #[prost(string, optional, tag = "3")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "TimeUnitTimeZone", optional, tag = "6")] - pub timezone: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct WindowTransformOp { - #[prost(oneof = "window_transform_op::Op", tags = "1, 2")] - pub op: ::core::option::Option, -} -/// Nested message and enum types in `WindowTransformOp`. -pub mod window_transform_op { - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] - pub enum Op { - #[prost(enumeration = "super::AggregateOp", tag = "1")] - AggregateOp(i32), - #[prost(enumeration = "super::WindowOp", tag = "2")] - WindowOp(i32), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Window { - #[prost(enumeration = "SortOrder", repeated, tag = "1")] - pub sort: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "2")] - pub sort_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "3")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "4")] - pub ops: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "5")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(double, repeated, tag = "6")] - pub params: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "7")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub frame: ::core::option::Option, - #[prost(bool, optional, tag = "9")] - pub ignore_peers: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct WindowFrame { - #[prost(int64, optional, tag = "1")] - pub start: ::core::option::Option, - #[prost(int64, optional, tag = "2")] - pub end: ::core::option::Option, -} -/// Project -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Project { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Stack -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Stack { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(enumeration = "StackOffset", tag = "2")] - pub offset: i32, - #[prost(enumeration = "SortOrder", repeated, tag = "3")] - pub sort: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub sort_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "5")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "6")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "7")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, -} -/// Impute -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Impute { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub key: ::prost::alloc::string::String, - #[prost(enumeration = "ImputeMethod", tag = "3")] - pub method: i32, - #[prost(string, repeated, tag = "4")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub value_json: ::core::option::Option<::prost::alloc::string::String>, -} -/// Pivot -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pivot { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(int32, optional, tag = "4")] - pub limit: ::core::option::Option, - #[prost(enumeration = "AggregateOp", optional, tag = "5")] - pub op: ::core::option::Option, -} -/// Identifier -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Identifier { - #[prost(string, tag = "1")] - pub r#as: ::prost::alloc::string::String, -} -/// Fold -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fold { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub r#as: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Sequence -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Sequence { - #[prost(message, optional, tag = "1")] - pub start: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub stop: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub step: ::core::option::Option, - #[prost(string, optional, tag = "4")] - pub r#as: ::core::option::Option<::prost::alloc::string::String>, -} -/// Top-level transform -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Transform { - #[prost( - oneof = "transform::TransformKind", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16" - )] - pub transform_kind: ::core::option::Option, -} -/// Nested message and enum types in `Transform`. -pub mod transform { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum TransformKind { - #[prost(message, tag = "1")] - Filter(super::Filter), - #[prost(message, tag = "2")] - Extent(super::Extent), - #[prost(message, tag = "3")] - Formula(super::Formula), - #[prost(message, tag = "4")] - Bin(super::Bin), - #[prost(message, tag = "5")] - Aggregate(super::Aggregate), - #[prost(message, tag = "6")] - Collect(super::Collect), - #[prost(message, tag = "7")] - Timeunit(super::TimeUnit), - #[prost(message, tag = "8")] - Joinaggregate(super::JoinAggregate), - #[prost(message, tag = "9")] - Window(super::Window), - #[prost(message, tag = "10")] - Project(super::Project), - #[prost(message, tag = "11")] - Stack(super::Stack), - #[prost(message, tag = "12")] - Impute(super::Impute), - #[prost(message, tag = "13")] - Pivot(super::Pivot), - #[prost(message, tag = "14")] - Identifier(super::Identifier), - #[prost(message, tag = "15")] - Fold(super::Fold), - #[prost(message, tag = "16")] - Sequence(super::Sequence), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransformPipeline { - #[prost(message, repeated, tag = "1")] - pub transforms: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum SortOrder { - Descending = 0, - Ascending = 1, -} -impl SortOrder { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Descending => "Descending", - Self::Ascending => "Ascending", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Descending" => Some(Self::Descending), - "Ascending" => Some(Self::Ascending), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AggregateOp { - Count = 0, - Valid = 1, - Missing = 2, - Distinct = 3, - Sum = 4, - Product = 5, - Mean = 6, - Average = 7, - Variance = 8, - Variancep = 9, - Stdev = 10, - Stdevp = 11, - Stderr = 12, - Median = 13, - Q1 = 14, - Q3 = 15, - Ci0 = 16, - Ci1 = 17, - Min = 18, - Max = 19, - Argmin = 20, - Argmax = 21, - Values = 22, -} -impl AggregateOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Count => "Count", - Self::Valid => "Valid", - Self::Missing => "Missing", - Self::Distinct => "Distinct", - Self::Sum => "Sum", - Self::Product => "Product", - Self::Mean => "Mean", - Self::Average => "Average", - Self::Variance => "Variance", - Self::Variancep => "Variancep", - Self::Stdev => "Stdev", - Self::Stdevp => "Stdevp", - Self::Stderr => "Stderr", - Self::Median => "Median", - Self::Q1 => "Q1", - Self::Q3 => "Q3", - Self::Ci0 => "Ci0", - Self::Ci1 => "Ci1", - Self::Min => "Min", - Self::Max => "Max", - Self::Argmin => "Argmin", - Self::Argmax => "Argmax", - Self::Values => "Values", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Count" => Some(Self::Count), - "Valid" => Some(Self::Valid), - "Missing" => Some(Self::Missing), - "Distinct" => Some(Self::Distinct), - "Sum" => Some(Self::Sum), - "Product" => Some(Self::Product), - "Mean" => Some(Self::Mean), - "Average" => Some(Self::Average), - "Variance" => Some(Self::Variance), - "Variancep" => Some(Self::Variancep), - "Stdev" => Some(Self::Stdev), - "Stdevp" => Some(Self::Stdevp), - "Stderr" => Some(Self::Stderr), - "Median" => Some(Self::Median), - "Q1" => Some(Self::Q1), - "Q3" => Some(Self::Q3), - "Ci0" => Some(Self::Ci0), - "Ci1" => Some(Self::Ci1), - "Min" => Some(Self::Min), - "Max" => Some(Self::Max), - "Argmin" => Some(Self::Argmin), - "Argmax" => Some(Self::Argmax), - "Values" => Some(Self::Values), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TimeUnitUnit { - Year = 0, - Quarter = 1, - Month = 2, - Date = 3, - Week = 4, - Day = 5, - DayOfYear = 6, - Hours = 7, - Minutes = 8, - Seconds = 9, - Milliseconds = 10, -} -impl TimeUnitUnit { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Year => "Year", - Self::Quarter => "Quarter", - Self::Month => "Month", - Self::Date => "Date", - Self::Week => "Week", - Self::Day => "Day", - Self::DayOfYear => "DayOfYear", - Self::Hours => "Hours", - Self::Minutes => "Minutes", - Self::Seconds => "Seconds", - Self::Milliseconds => "Milliseconds", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Year" => Some(Self::Year), - "Quarter" => Some(Self::Quarter), - "Month" => Some(Self::Month), - "Date" => Some(Self::Date), - "Week" => Some(Self::Week), - "Day" => Some(Self::Day), - "DayOfYear" => Some(Self::DayOfYear), - "Hours" => Some(Self::Hours), - "Minutes" => Some(Self::Minutes), - "Seconds" => Some(Self::Seconds), - "Milliseconds" => Some(Self::Milliseconds), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TimeUnitTimeZone { - Local = 0, - Utc = 1, -} -impl TimeUnitTimeZone { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Local => "Local", - Self::Utc => "Utc", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Local" => Some(Self::Local), - "Utc" => Some(Self::Utc), - _ => None, - } - } -} -/// Window -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum WindowOp { - RowNumber = 0, - Rank = 1, - DenseRank = 2, - PercentileRank = 3, - CumeDist = 4, - NTile = 5, - Lag = 6, - Lead = 7, - FirstValue = 8, - LastValue = 9, - NthValue = 10, - PrevValue = 11, - NextValue = 12, -} -impl WindowOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::RowNumber => "RowNumber", - Self::Rank => "Rank", - Self::DenseRank => "DenseRank", - Self::PercentileRank => "PercentileRank", - Self::CumeDist => "CumeDist", - Self::NTile => "NTile", - Self::Lag => "Lag", - Self::Lead => "Lead", - Self::FirstValue => "FirstValue", - Self::LastValue => "LastValue", - Self::NthValue => "NthValue", - Self::PrevValue => "PrevValue", - Self::NextValue => "NextValue", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "RowNumber" => Some(Self::RowNumber), - "Rank" => Some(Self::Rank), - "DenseRank" => Some(Self::DenseRank), - "PercentileRank" => Some(Self::PercentileRank), - "CumeDist" => Some(Self::CumeDist), - "NTile" => Some(Self::NTile), - "Lag" => Some(Self::Lag), - "Lead" => Some(Self::Lead), - "FirstValue" => Some(Self::FirstValue), - "LastValue" => Some(Self::LastValue), - "NthValue" => Some(Self::NthValue), - "PrevValue" => Some(Self::PrevValue), - "NextValue" => Some(Self::NextValue), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum StackOffset { - Zero = 0, - Center = 1, - Normalize = 2, -} -impl StackOffset { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Zero => "Zero", - Self::Center => "Center", - Self::Normalize => "Normalize", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Zero" => Some(Self::Zero), - "Center" => Some(Self::Center), - "Normalize" => Some(Self::Normalize), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ImputeMethod { - ImputeValue = 0, - ImputeMean = 1, - ImputeMedian = 2, - ImputeMax = 3, - ImputeMin = 4, -} -impl ImputeMethod { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::ImputeValue => "ImputeValue", - Self::ImputeMean => "ImputeMean", - Self::ImputeMedian => "ImputeMedian", - Self::ImputeMax => "ImputeMax", - Self::ImputeMin => "ImputeMin", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ImputeValue" => Some(Self::ImputeValue), - "ImputeMean" => Some(Self::ImputeMean), - "ImputeMedian" => Some(Self::ImputeMedian), - "ImputeMax" => Some(Self::ImputeMax), - "ImputeMin" => Some(Self::ImputeMin), - _ => None, - } - } -} diff --git a/vegafusion-core/src/proto/tonic_gen/errors.rs b/vegafusion-core/src/proto/tonic_gen/errors.rs deleted file mode 100644 index cd484ee8f..000000000 --- a/vegafusion-core/src/proto/tonic_gen/errors.rs +++ /dev/null @@ -1,19 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueError { - #[prost(string, tag = "1")] - pub msg: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Error { - #[prost(oneof = "error::Errorkind", tags = "1")] - pub errorkind: ::core::option::Option, -} -/// Nested message and enum types in `Error`. -pub mod error { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Errorkind { - #[prost(message, tag = "1")] - Error(super::TaskGraphValueError), - } -} diff --git a/vegafusion-core/src/proto/tonic_gen/expression.rs b/vegafusion-core/src/proto/tonic_gen/expression.rs deleted file mode 100644 index fbfc6ba32..000000000 --- a/vegafusion-core/src/proto/tonic_gen/expression.rs +++ /dev/null @@ -1,284 +0,0 @@ -// This file is @generated by prost-build. -/// ESTree-style AST nodes -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Span { - #[prost(int32, tag = "1")] - pub start: i32, - #[prost(int32, tag = "2")] - pub end: i32, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Literal { - #[prost(string, tag = "1")] - pub raw: ::prost::alloc::string::String, - #[prost(oneof = "literal::Value", tags = "2, 3, 4, 5")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `Literal`. -pub mod literal { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - #[prost(string, tag = "2")] - String(::prost::alloc::string::String), - #[prost(bool, tag = "3")] - Boolean(bool), - #[prost(double, tag = "4")] - Number(f64), - #[prost(bool, tag = "5")] - Null(bool), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifierAbc { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Identifier { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnaryExpression { - #[prost(enumeration = "UnaryOperator", tag = "1")] - pub operator: i32, - #[prost(bool, tag = "2")] - pub prefix: bool, - #[prost(message, optional, boxed, tag = "3")] - pub argument: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LogicalExpression { - #[prost(message, optional, boxed, tag = "1")] - pub left: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(enumeration = "LogicalOperator", tag = "2")] - pub operator: i32, - #[prost(message, optional, boxed, tag = "3")] - pub right: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BinaryExpression { - #[prost(message, optional, boxed, tag = "1")] - pub left: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(enumeration = "BinaryOperator", tag = "2")] - pub operator: i32, - #[prost(message, optional, boxed, tag = "3")] - pub right: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConditionalExpression { - #[prost(message, optional, boxed, tag = "1")] - pub test: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "2")] - pub consequent: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "3")] - pub alternate: ::core::option::Option<::prost::alloc::boxed::Box>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MemberExpression { - #[prost(message, optional, boxed, tag = "1")] - pub object: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(message, optional, boxed, tag = "2")] - pub property: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(bool, tag = "3")] - pub computed: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArrayExpression { - #[prost(message, repeated, tag = "1")] - pub elements: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CallExpression { - #[prost(string, tag = "1")] - pub callee: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub arguments: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Property { - #[prost(message, optional, tag = "3")] - pub value: ::core::option::Option, - #[prost(string, tag = "4")] - pub kind: ::prost::alloc::string::String, - #[prost(oneof = "property::Key", tags = "1, 2")] - pub key: ::core::option::Option, -} -/// Nested message and enum types in `Property`. -pub mod property { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Key { - #[prost(message, tag = "1")] - Literal(super::Literal), - #[prost(message, tag = "2")] - Identifier(super::Identifier), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ObjectExpression { - #[prost(message, repeated, tag = "1")] - pub properties: ::prost::alloc::vec::Vec, -} -/// Top-level expression -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Expression { - #[prost(message, optional, tag = "11")] - pub span: ::core::option::Option, - #[prost(oneof = "expression::Expr", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")] - pub expr: ::core::option::Option, -} -/// Nested message and enum types in `Expression`. -pub mod expression { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Expr { - #[prost(message, tag = "1")] - Identifier(super::Identifier), - #[prost(message, tag = "2")] - Literal(super::Literal), - #[prost(message, tag = "3")] - Binary(::prost::alloc::boxed::Box), - #[prost(message, tag = "4")] - Logical(::prost::alloc::boxed::Box), - #[prost(message, tag = "5")] - Unary(::prost::alloc::boxed::Box), - #[prost(message, tag = "6")] - Conditional(::prost::alloc::boxed::Box), - #[prost(message, tag = "7")] - Call(super::CallExpression), - #[prost(message, tag = "8")] - Array(super::ArrayExpression), - #[prost(message, tag = "9")] - Object(super::ObjectExpression), - #[prost(message, tag = "10")] - Member(::prost::alloc::boxed::Box), - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum UnaryOperator { - Pos = 0, - Neg = 1, - Not = 2, -} -impl UnaryOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Pos => "Pos", - Self::Neg => "Neg", - Self::Not => "Not", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Pos" => Some(Self::Pos), - "Neg" => Some(Self::Neg), - "Not" => Some(Self::Not), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LogicalOperator { - Or = 0, - And = 1, -} -impl LogicalOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Or => "Or", - Self::And => "And", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Or" => Some(Self::Or), - "And" => Some(Self::And), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum BinaryOperator { - Equals = 0, - NotEquals = 1, - StrictEquals = 2, - NotStrictEquals = 3, - LessThan = 4, - LessThanEqual = 5, - GreaterThan = 6, - GreaterThanEqual = 7, - Plus = 8, - Minus = 9, - Mult = 10, - Div = 11, - Mod = 12, - BitwiseAnd = 13, - BitwiseOr = 14, - BitwiseXor = 15, - BitwiseShiftLeft = 16, - BitwiseShiftRight = 17, -} -impl BinaryOperator { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Equals => "Equals", - Self::NotEquals => "NotEquals", - Self::StrictEquals => "StrictEquals", - Self::NotStrictEquals => "NotStrictEquals", - Self::LessThan => "LessThan", - Self::LessThanEqual => "LessThanEqual", - Self::GreaterThan => "GreaterThan", - Self::GreaterThanEqual => "GreaterThanEqual", - Self::Plus => "Plus", - Self::Minus => "Minus", - Self::Mult => "Mult", - Self::Div => "Div", - Self::Mod => "Mod", - Self::BitwiseAnd => "BitwiseAnd", - Self::BitwiseOr => "BitwiseOr", - Self::BitwiseXor => "BitwiseXor", - Self::BitwiseShiftLeft => "BitwiseShiftLeft", - Self::BitwiseShiftRight => "BitwiseShiftRight", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Equals" => Some(Self::Equals), - "NotEquals" => Some(Self::NotEquals), - "StrictEquals" => Some(Self::StrictEquals), - "NotStrictEquals" => Some(Self::NotStrictEquals), - "LessThan" => Some(Self::LessThan), - "LessThanEqual" => Some(Self::LessThanEqual), - "GreaterThan" => Some(Self::GreaterThan), - "GreaterThanEqual" => Some(Self::GreaterThanEqual), - "Plus" => Some(Self::Plus), - "Minus" => Some(Self::Minus), - "Mult" => Some(Self::Mult), - "Div" => Some(Self::Div), - "Mod" => Some(Self::Mod), - "BitwiseAnd" => Some(Self::BitwiseAnd), - "BitwiseOr" => Some(Self::BitwiseOr), - "BitwiseXor" => Some(Self::BitwiseXor), - "BitwiseShiftLeft" => Some(Self::BitwiseShiftLeft), - "BitwiseShiftRight" => Some(Self::BitwiseShiftRight), - _ => None, - } - } -} diff --git a/vegafusion-core/src/proto/tonic_gen/mod.rs b/vegafusion-core/src/proto/tonic_gen/mod.rs deleted file mode 100644 index e9f0fc872..000000000 --- a/vegafusion-core/src/proto/tonic_gen/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod expression; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod transforms; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod tasks; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod errors; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod pretransform; - -#[rustfmt::skip] -#[allow(clippy::all)] -pub mod services; diff --git a/vegafusion-core/src/proto/tonic_gen/pretransform.rs b/vegafusion-core/src/proto/tonic_gen/pretransform.rs deleted file mode 100644 index f684c5978..000000000 --- a/vegafusion-core/src/proto/tonic_gen/pretransform.rs +++ /dev/null @@ -1,175 +0,0 @@ -// This file is @generated by prost-build. -/// / Pre transform spec messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecOpts { - #[prost(uint32, optional, tag = "1")] - pub row_limit: ::core::option::Option, - #[prost(bool, tag = "2")] - pub preserve_interactivity: bool, - #[prost(message, repeated, tag = "3")] - pub keep_variables: ::prost::alloc::vec::Vec, - #[prost(string, tag = "4")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "5")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub opts: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecResponse { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecWarning { - #[prost(oneof = "pre_transform_spec_warning::WarningType", tags = "1, 2, 3, 4")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformSpecWarning`. -pub mod pre_transform_spec_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - RowLimit(super::PreTransformRowLimitWarning), - #[prost(message, tag = "2")] - BrokenInteractivity(super::PreTransformBrokenInteractivityWarning), - #[prost(message, tag = "3")] - Unsupported(super::PreTransformUnsupportedWarning), - #[prost(message, tag = "4")] - Planner(super::PlannerWarning), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformRowLimitWarning { - #[prost(message, repeated, tag = "1")] - pub datasets: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformBrokenInteractivityWarning { - #[prost(message, repeated, tag = "1")] - pub vars: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct PreTransformUnsupportedWarning {} -/// / Pre transform value messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformVariable { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesOpts { - #[prost(uint32, optional, tag = "1")] - pub row_limit: ::core::option::Option, - #[prost(string, tag = "2")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "3")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub variables: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub opts: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesResponse { - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesWarning { - #[prost(oneof = "pre_transform_values_warning::WarningType", tags = "1, 2")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformValuesWarning`. -pub mod pre_transform_values_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - RowLimit(super::PreTransformRowLimitWarning), - #[prost(message, tag = "2")] - Planner(super::PlannerWarning), - } -} -/// / Common pre-transform messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PlannerWarning { - #[prost(string, tag = "1")] - pub message: ::prost::alloc::string::String, -} -/// / Pre Transform Extract Datasets -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractDataset { - /// Result dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Result dataset scope - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes = "vec", tag = "3")] - pub table: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractOpts { - #[prost(string, tag = "1")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, - #[prost(bool, tag = "3")] - pub preserve_interactivity: bool, - #[prost(int32, tag = "4")] - pub extract_threshold: i32, - #[prost(message, repeated, tag = "5")] - pub keep_variables: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractWarning { - #[prost(oneof = "pre_transform_extract_warning::WarningType", tags = "1")] - pub warning_type: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformExtractWarning`. -pub mod pre_transform_extract_warning { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WarningType { - #[prost(message, tag = "1")] - Planner(super::PlannerWarning), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractResponse { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub datasets: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub warnings: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractRequest { - #[prost(string, tag = "1")] - pub spec: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub inline_datasets: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub opts: ::core::option::Option, -} diff --git a/vegafusion-core/src/proto/tonic_gen/services.rs b/vegafusion-core/src/proto/tonic_gen/services.rs deleted file mode 100644 index 56878659b..000000000 --- a/vegafusion-core/src/proto/tonic_gen/services.rs +++ /dev/null @@ -1,631 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRequest { - #[prost(oneof = "query_request::Request", tags = "1")] - pub request: ::core::option::Option, -} -/// Nested message and enum types in `QueryRequest`. -pub mod query_request { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Request { - #[prost(message, tag = "1")] - TaskGraphValues(super::super::tasks::TaskGraphValueRequest), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryResult { - #[prost(oneof = "query_result::Response", tags = "1, 2")] - pub response: ::core::option::Option, -} -/// Nested message and enum types in `QueryResult`. -pub mod query_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Response { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - TaskGraphValues(super::super::tasks::TaskGraphValueResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformSpecResult { - #[prost(oneof = "pre_transform_spec_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformSpecResult`. -pub mod pre_transform_spec_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformSpecResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformValuesResult { - #[prost(oneof = "pre_transform_values_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformValuesResult`. -pub mod pre_transform_values_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformValuesResponse), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreTransformExtractResult { - #[prost(oneof = "pre_transform_extract_result::Result", tags = "1, 2")] - pub result: ::core::option::Option, -} -/// Nested message and enum types in `PreTransformExtractResult`. -pub mod pre_transform_extract_result { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Result { - #[prost(message, tag = "1")] - Error(super::super::errors::Error), - #[prost(message, tag = "2")] - Response(super::super::pretransform::PreTransformExtractResponse), - } -} -/// Generated client implementations. -pub mod vega_fusion_runtime_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct VegaFusionRuntimeClient { - inner: tonic::client::Grpc, - } - impl VegaFusionRuntimeClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl VegaFusionRuntimeClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> VegaFusionRuntimeClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - VegaFusionRuntimeClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn task_graph_query( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.VegaFusionRuntime/TaskGraphQuery", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.VegaFusionRuntime", "TaskGraphQuery")); - self.inner.unary(req, path, codec).await - } - pub async fn pre_transform_spec( - &mut self, - request: impl tonic::IntoRequest< - super::super::pretransform::PreTransformSpecRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.VegaFusionRuntime/PreTransformSpec", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.VegaFusionRuntime", "PreTransformSpec"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn pre_transform_values( - &mut self, - request: impl tonic::IntoRequest< - super::super::pretransform::PreTransformValuesRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.VegaFusionRuntime/PreTransformValues", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.VegaFusionRuntime", "PreTransformValues"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn pre_transform_extract( - &mut self, - request: impl tonic::IntoRequest< - super::super::pretransform::PreTransformExtractRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.VegaFusionRuntime/PreTransformExtract", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.VegaFusionRuntime", "PreTransformExtract"), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod vega_fusion_runtime_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with VegaFusionRuntimeServer. - #[async_trait] - pub trait VegaFusionRuntime: std::marker::Send + std::marker::Sync + 'static { - async fn task_graph_query( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn pre_transform_spec( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn pre_transform_values( - &self, - request: tonic::Request< - super::super::pretransform::PreTransformValuesRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn pre_transform_extract( - &self, - request: tonic::Request< - super::super::pretransform::PreTransformExtractRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct VegaFusionRuntimeServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl VegaFusionRuntimeServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for VegaFusionRuntimeServer - where - T: VegaFusionRuntime, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/services.VegaFusionRuntime/TaskGraphQuery" => { - #[allow(non_camel_case_types)] - struct TaskGraphQuerySvc(pub Arc); - impl< - T: VegaFusionRuntime, - > tonic::server::UnaryService - for TaskGraphQuerySvc { - type Response = super::QueryResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::task_graph_query(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = TaskGraphQuerySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/services.VegaFusionRuntime/PreTransformSpec" => { - #[allow(non_camel_case_types)] - struct PreTransformSpecSvc(pub Arc); - impl< - T: VegaFusionRuntime, - > tonic::server::UnaryService< - super::super::pretransform::PreTransformSpecRequest, - > for PreTransformSpecSvc { - type Response = super::PreTransformSpecResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::pretransform::PreTransformSpecRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pre_transform_spec( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = PreTransformSpecSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/services.VegaFusionRuntime/PreTransformValues" => { - #[allow(non_camel_case_types)] - struct PreTransformValuesSvc(pub Arc); - impl< - T: VegaFusionRuntime, - > tonic::server::UnaryService< - super::super::pretransform::PreTransformValuesRequest, - > for PreTransformValuesSvc { - type Response = super::PreTransformValuesResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::pretransform::PreTransformValuesRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pre_transform_values( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = PreTransformValuesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/services.VegaFusionRuntime/PreTransformExtract" => { - #[allow(non_camel_case_types)] - struct PreTransformExtractSvc(pub Arc); - impl< - T: VegaFusionRuntime, - > tonic::server::UnaryService< - super::super::pretransform::PreTransformExtractRequest, - > for PreTransformExtractSvc { - type Response = super::PreTransformExtractResult; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::pretransform::PreTransformExtractRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pre_transform_extract( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = PreTransformExtractSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for VegaFusionRuntimeServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "services.VegaFusionRuntime"; - impl tonic::server::NamedService for VegaFusionRuntimeServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/vegafusion-core/src/proto/tonic_gen/tasks.rs b/vegafusion-core/src/proto/tonic_gen/tasks.rs deleted file mode 100644 index 5d7f6f233..000000000 --- a/vegafusion-core/src/proto/tonic_gen/tasks.rs +++ /dev/null @@ -1,295 +0,0 @@ -// This file is @generated by prost-build. -/// ## Task Value -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskValue { - #[prost(oneof = "task_value::Data", tags = "1, 2")] - pub data: ::core::option::Option, -} -/// Nested message and enum types in `TaskValue`. -pub mod task_value { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Data { - /// - /// Representation of scalar as single column, single row, record batch in Arrow IPC format - #[prost(bytes, tag = "1")] - Scalar(::prost::alloc::vec::Vec), - /// - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes, tag = "2")] - Table(::prost::alloc::vec::Vec), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Variable { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(enumeration = "VariableNamespace", tag = "2")] - pub namespace: i32, -} -/// ## Scan URL Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParseFieldSpec { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub datatype: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParseFieldSpecs { - #[prost(message, repeated, tag = "1")] - pub specs: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScanUrlFormat { - /// - /// The data format type. The currently supported data formats are json (the default), - /// csv (comma-separated values), tsv (tab-separated values), dsv (delimited text files), - /// and topojson. - #[prost(string, optional, tag = "1")] - pub r#type: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub property: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "5")] - pub header: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "6")] - pub delimiter: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "7")] - pub feature: ::core::option::Option<::prost::alloc::string::String>, - /// - /// JSON encoded string: - /// If set to auto, perform automatic type inference to determine the desired data types. - /// Alternatively, a parsing directive object can be provided for explicit data types. - /// Each property of the object corresponds to a field name, and the value to the desired data type - /// (one of "boolean", "date", "number" or "string"). For example, "parse": {"modified_on": "date"} - /// parses the modified_on field in each input record as a Date value. Specific date formats can - /// be provided (e.g., {"foo": "date:'%m%d%Y'"}), using the d3-time-format syntax. UTC date format - /// parsing is supported similarly (e.g., {"foo": "utc:'%m%d%Y'"}). - #[prost(oneof = "scan_url_format::Parse", tags = "2, 3")] - pub parse: ::core::option::Option, -} -/// Nested message and enum types in `ScanUrlFormat`. -pub mod scan_url_format { - /// - /// JSON encoded string: - /// If set to auto, perform automatic type inference to determine the desired data types. - /// Alternatively, a parsing directive object can be provided for explicit data types. - /// Each property of the object corresponds to a field name, and the value to the desired data type - /// (one of "boolean", "date", "number" or "string"). For example, "parse": {"modified_on": "date"} - /// parses the modified_on field in each input record as a Date value. Specific date formats can - /// be provided (e.g., {"foo": "date:'%m%d%Y'"}), using the d3-time-format syntax. UTC date format - /// parsing is supported similarly (e.g., {"foo": "utc:'%m%d%Y'"}). - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parse { - #[prost(string, tag = "2")] - String(::prost::alloc::string::String), - #[prost(message, tag = "3")] - Object(super::ParseFieldSpecs), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataUrlTask { - #[prost(int32, tag = "3")] - pub batch_size: i32, - #[prost(message, optional, tag = "4")] - pub format_type: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub pipeline: ::core::option::Option, - #[prost(oneof = "data_url_task::Url", tags = "1, 2")] - pub url: ::core::option::Option, -} -/// Nested message and enum types in `DataUrlTask`. -pub mod data_url_task { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Url { - #[prost(string, tag = "1")] - String(::prost::alloc::string::String), - #[prost(message, tag = "2")] - Expr(super::super::expression::Expression), - } -} -/// ## Inline values task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataValuesTask { - #[prost(bytes = "vec", tag = "1")] - pub values: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub format_type: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub pipeline: ::core::option::Option, -} -/// ## Transform Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataSourceTask { - #[prost(string, tag = "1")] - pub source: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pipeline: ::core::option::Option, -} -/// ## Signal Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignalTask { - #[prost(message, optional, tag = "2")] - pub expr: ::core::option::Option, -} -/// ## Timezone config -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TzConfig { - #[prost(string, tag = "1")] - pub local_tz: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub default_input_tz: ::core::option::Option<::prost::alloc::string::String>, -} -/// ## Top-level Task -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Task { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub tz_config: ::core::option::Option, - #[prost(oneof = "task::TaskKind", tags = "3, 4, 5, 6, 7")] - pub task_kind: ::core::option::Option, -} -/// Nested message and enum types in `Task`. -pub mod task { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum TaskKind { - #[prost(message, tag = "3")] - Value(super::TaskValue), - #[prost(message, tag = "4")] - DataValues(super::DataValuesTask), - #[prost(message, tag = "5")] - DataUrl(super::DataUrlTask), - #[prost(message, tag = "6")] - DataSource(super::DataSourceTask), - #[prost(message, tag = "7")] - Signal(super::SignalTask), - } -} -/// ## Task Graph -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct IncomingEdge { - #[prost(uint32, tag = "1")] - pub source: u32, - #[prost(uint32, optional, tag = "2")] - pub output: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct OutgoingEdge { - #[prost(uint32, tag = "1")] - pub target: u32, - #[prost(bool, tag = "2")] - pub propagate: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskNode { - #[prost(message, optional, tag = "1")] - pub task: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub incoming: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub outgoing: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - pub id_fingerprint: u64, - #[prost(uint64, tag = "5")] - pub state_fingerprint: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraph { - #[prost(message, repeated, tag = "1")] - pub nodes: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct NodeValueIndex { - #[prost(uint32, tag = "1")] - pub node_index: u32, - #[prost(uint32, optional, tag = "2")] - pub output_index: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueRequest { - #[prost(message, optional, tag = "1")] - pub task_graph: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub indices: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub inline_datasets: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResponseTaskValue { - #[prost(message, optional, tag = "1")] - pub variable: ::core::option::Option, - #[prost(uint32, repeated, tag = "2")] - pub scope: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub value: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TaskGraphValueResponse { - #[prost(message, repeated, tag = "1")] - pub response_values: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDatasetTable { - /// Inline dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Serialized Arrow record batch in Arrow IPC format - #[prost(bytes = "vec", tag = "2")] - pub table: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDatasetPlan { - /// Inline dataset name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Serialized DataFusion plan in protobuf format - #[prost(bytes = "vec", tag = "2")] - pub plan: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InlineDataset { - #[prost(oneof = "inline_dataset::Dataset", tags = "1, 2")] - pub dataset: ::core::option::Option, -} -/// Nested message and enum types in `InlineDataset`. -pub mod inline_dataset { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Dataset { - #[prost(message, tag = "1")] - Table(super::InlineDatasetTable), - #[prost(message, tag = "2")] - Plan(super::InlineDatasetPlan), - } -} -/// ## Variable -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VariableNamespace { - Signal = 0, - Data = 1, - Scale = 2, -} -impl VariableNamespace { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Signal => "Signal", - Self::Data => "Data", - Self::Scale => "Scale", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Signal" => Some(Self::Signal), - "Data" => Some(Self::Data), - "Scale" => Some(Self::Scale), - _ => None, - } - } -} diff --git a/vegafusion-core/src/proto/tonic_gen/transforms.rs b/vegafusion-core/src/proto/tonic_gen/transforms.rs deleted file mode 100644 index fa9f3283e..000000000 --- a/vegafusion-core/src/proto/tonic_gen/transforms.rs +++ /dev/null @@ -1,606 +0,0 @@ -// This file is @generated by prost-build. -/// Filter -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Filter { - #[prost(message, optional, tag = "1")] - pub expr: ::core::option::Option, -} -/// Formula -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Formula { - #[prost(message, optional, tag = "1")] - pub expr: ::core::option::Option, - #[prost(string, tag = "2")] - pub r#as: ::prost::alloc::string::String, -} -/// Extent -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Extent { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, -} -/// Collect -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Collect { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "SortOrder", repeated, tag = "2")] - pub order: ::prost::alloc::vec::Vec, -} -/// Bin -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Bin { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub extent: ::core::option::Option, - #[prost(string, optional, tag = "3")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, - /// A value in the binned domain at which to anchor the bins The bin boundaries will be shifted, - /// if necessary, to ensure that a boundary aligns with the anchor value. - #[prost(double, optional, tag = "6")] - pub anchor: ::core::option::Option, - /// The maximum number of bins allowed - #[prost(message, optional, tag = "7")] - pub maxbins: ::core::option::Option, - /// The number base to use for automatic bin selection (e.g. base 10) - #[prost(double, tag = "8")] - pub base: f64, - /// An exact step size to use between bins. Overrides other options. - #[prost(double, optional, tag = "9")] - pub step: ::core::option::Option, - /// A list of allowable step sizes to choose from - #[prost(double, repeated, tag = "10")] - pub steps: ::prost::alloc::vec::Vec, - /// The value span over which to generate bin boundaries. Defaults to the exact extent of the data - #[prost(message, optional, tag = "11")] - pub span: ::core::option::Option, - /// A minimum distance between adjacent bins - #[prost(double, tag = "12")] - pub minstep: f64, - /// Scale factors indicating the allowed subdivisions. The defualt value is vec!\[5.0, 2.0\], - /// which indicates that for base 10 numbers, the method may consider dividing bin sizes by 5 and/or 2. - #[prost(double, repeated, tag = "13")] - pub divide: ::prost::alloc::vec::Vec, - /// If true, attempt to make the bin boundaries use human-friendly boundaries - /// (e.g. whole numbers, multiples of 10, etc.) - #[prost(bool, tag = "14")] - pub nice: bool, -} -/// Aggregate -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Aggregate { - #[prost(string, repeated, tag = "1")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "3")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "AggregateOp", repeated, tag = "4")] - pub ops: ::prost::alloc::vec::Vec, -} -/// JoinAggregate -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct JoinAggregate { - #[prost(string, repeated, tag = "1")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "AggregateOp", repeated, tag = "3")] - pub ops: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// TimeUnit -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimeUnit { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(enumeration = "TimeUnitUnit", repeated, tag = "2")] - pub units: ::prost::alloc::vec::Vec, - #[prost(string, optional, tag = "3")] - pub signal: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "4")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "TimeUnitTimeZone", optional, tag = "6")] - pub timezone: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct WindowTransformOp { - #[prost(oneof = "window_transform_op::Op", tags = "1, 2")] - pub op: ::core::option::Option, -} -/// Nested message and enum types in `WindowTransformOp`. -pub mod window_transform_op { - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] - pub enum Op { - #[prost(enumeration = "super::AggregateOp", tag = "1")] - AggregateOp(i32), - #[prost(enumeration = "super::WindowOp", tag = "2")] - WindowOp(i32), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Window { - #[prost(enumeration = "SortOrder", repeated, tag = "1")] - pub sort: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "2")] - pub sort_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "3")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "4")] - pub ops: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "5")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(double, repeated, tag = "6")] - pub params: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "7")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub frame: ::core::option::Option, - #[prost(bool, optional, tag = "9")] - pub ignore_peers: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct WindowFrame { - #[prost(int64, optional, tag = "1")] - pub start: ::core::option::Option, - #[prost(int64, optional, tag = "2")] - pub end: ::core::option::Option, -} -/// Project -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Project { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Stack -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Stack { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(enumeration = "StackOffset", tag = "2")] - pub offset: i32, - #[prost(enumeration = "SortOrder", repeated, tag = "3")] - pub sort: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub sort_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "5")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "6")] - pub alias_0: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "7")] - pub alias_1: ::core::option::Option<::prost::alloc::string::String>, -} -/// Impute -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Impute { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub key: ::prost::alloc::string::String, - #[prost(enumeration = "ImputeMethod", tag = "3")] - pub method: i32, - #[prost(string, repeated, tag = "4")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, optional, tag = "5")] - pub value_json: ::core::option::Option<::prost::alloc::string::String>, -} -/// Pivot -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pivot { - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub groupby: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(int32, optional, tag = "4")] - pub limit: ::core::option::Option, - #[prost(enumeration = "AggregateOp", optional, tag = "5")] - pub op: ::core::option::Option, -} -/// Identifier -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Identifier { - #[prost(string, tag = "1")] - pub r#as: ::prost::alloc::string::String, -} -/// Fold -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fold { - #[prost(string, repeated, tag = "1")] - pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "2")] - pub r#as: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Sequence -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Sequence { - #[prost(message, optional, tag = "1")] - pub start: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub stop: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub step: ::core::option::Option, - #[prost(string, optional, tag = "4")] - pub r#as: ::core::option::Option<::prost::alloc::string::String>, -} -/// Top-level transform -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Transform { - #[prost( - oneof = "transform::TransformKind", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16" - )] - pub transform_kind: ::core::option::Option, -} -/// Nested message and enum types in `Transform`. -pub mod transform { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum TransformKind { - #[prost(message, tag = "1")] - Filter(super::Filter), - #[prost(message, tag = "2")] - Extent(super::Extent), - #[prost(message, tag = "3")] - Formula(super::Formula), - #[prost(message, tag = "4")] - Bin(super::Bin), - #[prost(message, tag = "5")] - Aggregate(super::Aggregate), - #[prost(message, tag = "6")] - Collect(super::Collect), - #[prost(message, tag = "7")] - Timeunit(super::TimeUnit), - #[prost(message, tag = "8")] - Joinaggregate(super::JoinAggregate), - #[prost(message, tag = "9")] - Window(super::Window), - #[prost(message, tag = "10")] - Project(super::Project), - #[prost(message, tag = "11")] - Stack(super::Stack), - #[prost(message, tag = "12")] - Impute(super::Impute), - #[prost(message, tag = "13")] - Pivot(super::Pivot), - #[prost(message, tag = "14")] - Identifier(super::Identifier), - #[prost(message, tag = "15")] - Fold(super::Fold), - #[prost(message, tag = "16")] - Sequence(super::Sequence), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransformPipeline { - #[prost(message, repeated, tag = "1")] - pub transforms: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum SortOrder { - Descending = 0, - Ascending = 1, -} -impl SortOrder { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Descending => "Descending", - Self::Ascending => "Ascending", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Descending" => Some(Self::Descending), - "Ascending" => Some(Self::Ascending), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AggregateOp { - Count = 0, - Valid = 1, - Missing = 2, - Distinct = 3, - Sum = 4, - Product = 5, - Mean = 6, - Average = 7, - Variance = 8, - Variancep = 9, - Stdev = 10, - Stdevp = 11, - Stderr = 12, - Median = 13, - Q1 = 14, - Q3 = 15, - Ci0 = 16, - Ci1 = 17, - Min = 18, - Max = 19, - Argmin = 20, - Argmax = 21, - Values = 22, -} -impl AggregateOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Count => "Count", - Self::Valid => "Valid", - Self::Missing => "Missing", - Self::Distinct => "Distinct", - Self::Sum => "Sum", - Self::Product => "Product", - Self::Mean => "Mean", - Self::Average => "Average", - Self::Variance => "Variance", - Self::Variancep => "Variancep", - Self::Stdev => "Stdev", - Self::Stdevp => "Stdevp", - Self::Stderr => "Stderr", - Self::Median => "Median", - Self::Q1 => "Q1", - Self::Q3 => "Q3", - Self::Ci0 => "Ci0", - Self::Ci1 => "Ci1", - Self::Min => "Min", - Self::Max => "Max", - Self::Argmin => "Argmin", - Self::Argmax => "Argmax", - Self::Values => "Values", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Count" => Some(Self::Count), - "Valid" => Some(Self::Valid), - "Missing" => Some(Self::Missing), - "Distinct" => Some(Self::Distinct), - "Sum" => Some(Self::Sum), - "Product" => Some(Self::Product), - "Mean" => Some(Self::Mean), - "Average" => Some(Self::Average), - "Variance" => Some(Self::Variance), - "Variancep" => Some(Self::Variancep), - "Stdev" => Some(Self::Stdev), - "Stdevp" => Some(Self::Stdevp), - "Stderr" => Some(Self::Stderr), - "Median" => Some(Self::Median), - "Q1" => Some(Self::Q1), - "Q3" => Some(Self::Q3), - "Ci0" => Some(Self::Ci0), - "Ci1" => Some(Self::Ci1), - "Min" => Some(Self::Min), - "Max" => Some(Self::Max), - "Argmin" => Some(Self::Argmin), - "Argmax" => Some(Self::Argmax), - "Values" => Some(Self::Values), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TimeUnitUnit { - Year = 0, - Quarter = 1, - Month = 2, - Date = 3, - Week = 4, - Day = 5, - DayOfYear = 6, - Hours = 7, - Minutes = 8, - Seconds = 9, - Milliseconds = 10, -} -impl TimeUnitUnit { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Year => "Year", - Self::Quarter => "Quarter", - Self::Month => "Month", - Self::Date => "Date", - Self::Week => "Week", - Self::Day => "Day", - Self::DayOfYear => "DayOfYear", - Self::Hours => "Hours", - Self::Minutes => "Minutes", - Self::Seconds => "Seconds", - Self::Milliseconds => "Milliseconds", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Year" => Some(Self::Year), - "Quarter" => Some(Self::Quarter), - "Month" => Some(Self::Month), - "Date" => Some(Self::Date), - "Week" => Some(Self::Week), - "Day" => Some(Self::Day), - "DayOfYear" => Some(Self::DayOfYear), - "Hours" => Some(Self::Hours), - "Minutes" => Some(Self::Minutes), - "Seconds" => Some(Self::Seconds), - "Milliseconds" => Some(Self::Milliseconds), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TimeUnitTimeZone { - Local = 0, - Utc = 1, -} -impl TimeUnitTimeZone { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Local => "Local", - Self::Utc => "Utc", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Local" => Some(Self::Local), - "Utc" => Some(Self::Utc), - _ => None, - } - } -} -/// Window -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum WindowOp { - RowNumber = 0, - Rank = 1, - DenseRank = 2, - PercentileRank = 3, - CumeDist = 4, - NTile = 5, - Lag = 6, - Lead = 7, - FirstValue = 8, - LastValue = 9, - NthValue = 10, - PrevValue = 11, - NextValue = 12, -} -impl WindowOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::RowNumber => "RowNumber", - Self::Rank => "Rank", - Self::DenseRank => "DenseRank", - Self::PercentileRank => "PercentileRank", - Self::CumeDist => "CumeDist", - Self::NTile => "NTile", - Self::Lag => "Lag", - Self::Lead => "Lead", - Self::FirstValue => "FirstValue", - Self::LastValue => "LastValue", - Self::NthValue => "NthValue", - Self::PrevValue => "PrevValue", - Self::NextValue => "NextValue", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "RowNumber" => Some(Self::RowNumber), - "Rank" => Some(Self::Rank), - "DenseRank" => Some(Self::DenseRank), - "PercentileRank" => Some(Self::PercentileRank), - "CumeDist" => Some(Self::CumeDist), - "NTile" => Some(Self::NTile), - "Lag" => Some(Self::Lag), - "Lead" => Some(Self::Lead), - "FirstValue" => Some(Self::FirstValue), - "LastValue" => Some(Self::LastValue), - "NthValue" => Some(Self::NthValue), - "PrevValue" => Some(Self::PrevValue), - "NextValue" => Some(Self::NextValue), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum StackOffset { - Zero = 0, - Center = 1, - Normalize = 2, -} -impl StackOffset { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Zero => "Zero", - Self::Center => "Center", - Self::Normalize => "Normalize", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Zero" => Some(Self::Zero), - "Center" => Some(Self::Center), - "Normalize" => Some(Self::Normalize), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ImputeMethod { - ImputeValue = 0, - ImputeMean = 1, - ImputeMedian = 2, - ImputeMax = 3, - ImputeMin = 4, -} -impl ImputeMethod { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::ImputeValue => "ImputeValue", - Self::ImputeMean => "ImputeMean", - Self::ImputeMedian => "ImputeMedian", - Self::ImputeMax => "ImputeMax", - Self::ImputeMin => "ImputeMin", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ImputeValue" => Some(Self::ImputeValue), - "ImputeMean" => Some(Self::ImputeMean), - "ImputeMedian" => Some(Self::ImputeMedian), - "ImputeMax" => Some(Self::ImputeMax), - "ImputeMin" => Some(Self::ImputeMin), - _ => None, - } - } -} diff --git a/vegafusion-core/src/runtime/runtime.rs b/vegafusion-core/src/runtime/runtime.rs index 52ddff22d..a6e1560e4 100644 --- a/vegafusion-core/src/runtime/runtime.rs +++ b/vegafusion-core/src/runtime/runtime.rs @@ -332,7 +332,7 @@ pub trait VegaFusionRuntimeTrait: Send + Sync { .iter() .map(|var| { if let Some(index) = task_graph_mapping.get(&(var.0.clone(), var.1.clone())) { - Ok(index.clone()) + Ok(*index) } else { Err(VegaFusionError::pre_transform(format!( "Requested variable {var:?}\n requires transforms or signal \ diff --git a/vegafusion-runtime/benches/spec_benchmarks.rs b/vegafusion-runtime/benches/spec_benchmarks.rs index d229fd5f9..8e19f9ef0 100644 --- a/vegafusion-runtime/benches/spec_benchmarks.rs +++ b/vegafusion-runtime/benches/spec_benchmarks.rs @@ -60,13 +60,13 @@ async fn eval_spec_get_variable(full_spec: ChartSpec, var: &ScopedVariable) -> V let _request = QueryRequest { request: Some(Request::TaskGraphValues(TaskGraphValueRequest { task_graph: Some(task_graph.clone()), - indices: vec![node_index.clone()], + indices: vec![*node_index], inline_datasets: vec![], })), }; runtime - .query_request(Arc::new(task_graph), &[node_index.clone()], &HashMap::new()) + .query_request(Arc::new(task_graph), &[*node_index], &HashMap::new()) .await .unwrap() } @@ -109,7 +109,7 @@ async fn eval_spec_sequence(full_spec: ChartSpec, full_updates: Vec InlineDataset { dataset: Some(Dataset::Plan(InlineDatasetPlan { name: name.clone(), - plan: logical_plan_to_bytes(&plan)?.to_vec(), + plan: logical_plan_to_bytes(plan)?.to_vec(), })), }, #[cfg(not(feature = "proto"))] diff --git a/vegafusion-runtime/src/transform/bin.rs b/vegafusion-runtime/src/transform/bin.rs index b76124a0a..df2ffffc0 100644 --- a/vegafusion-runtime/src/transform/bin.rs +++ b/vegafusion-runtime/src/transform/bin.rs @@ -194,7 +194,7 @@ pub fn calculate_bin_params( } } - let maxbins = compile(&tx.maxbins.as_ref().unwrap(), config, Some(schema))? + let maxbins = compile(tx.maxbins.as_ref().unwrap(), config, Some(schema))? .eval_to_scalar()? .to_f64()?;