From e53aff5221e82568be525e721cf8c76761924e78 Mon Sep 17 00:00:00 2001 From: Paul Stack Date: Wed, 19 Feb 2025 21:00:43 +0000 Subject: [PATCH] Revert "feat(dal): Add support for Float backend type" --- app/web/src/api/sdf/dal/func.ts | 2 -- app/web/src/api/sdf/dal/prop.ts | 1 - .../src/assets/static/editor_typescript.txt | 9 +++-- bin/lang-js/src/asset_builder.ts | 3 +- lib/cyclone-core/src/resolver_function.rs | 1 - lib/dal/src/attribute/value.rs | 6 +--- lib/dal/src/func.rs | 1 - lib/dal/src/func/argument.rs | 7 ---- lib/dal/src/func/backend.rs | 9 ----- lib/dal/src/func/backend/array.rs | 2 -- lib/dal/src/func/backend/float.rs | 36 ------------------- lib/dal/src/func/backend/js_attribute.rs | 1 - lib/dal/src/func/binding/attribute.rs | 1 - lib/dal/src/func/intrinsics.rs | 17 --------- lib/dal/src/func/kind.rs | 1 - lib/dal/src/func/runner.rs | 2 -- lib/dal/src/management/mod.rs | 6 +--- lib/dal/src/pkg.rs | 4 --- lib/dal/src/pkg/export.rs | 2 -- lib/dal/src/pkg/import.rs | 1 - lib/dal/src/prop.rs | 9 ++--- lib/dal/src/property_editor/schema.rs | 2 -- lib/dal/src/schema/variant.rs | 1 - .../func/authoring/binding.rs | 2 -- lib/dal/tests/integration_test/module.rs | 3 +- lib/si-events-rs/src/func_run.rs | 3 -- lib/si-frontend-types-rs/src/func.rs | 1 - .../src/schema_variant.rs | 1 - lib/si-pkg/src/node/prop.rs | 32 ----------------- lib/si-pkg/src/pkg/prop.rs | 26 -------------- lib/si-pkg/src/pkg/variant.rs | 7 ---- lib/si-pkg/src/spec/func.rs | 3 -- lib/si-pkg/src/spec/prop.rs | 21 +---------- 33 files changed, 11 insertions(+), 212 deletions(-) delete mode 100644 lib/dal/src/func/backend/float.rs diff --git a/app/web/src/api/sdf/dal/func.ts b/app/web/src/api/sdf/dal/func.ts index 4f01403be9..175bb1373d 100644 --- a/app/web/src/api/sdf/dal/func.ts +++ b/app/web/src/api/sdf/dal/func.ts @@ -90,7 +90,6 @@ export const isCustomizableFuncKind = (f: FuncKind) => export enum FuncArgumentKind { Array = "array", Boolean = "boolean", - Float = "float", Integer = "integer", Json = "json", Object = "object", @@ -113,7 +112,6 @@ export enum FuncBackendKind { Boolean = "Boolean", Diff = "Diff", Identity = "Identity", - Float = "Float", Integer = "Integer", JsAction = "JsAction", JsAttribute = "JsAction", diff --git a/app/web/src/api/sdf/dal/prop.ts b/app/web/src/api/sdf/dal/prop.ts index bbbfa0348a..b9c551f34a 100644 --- a/app/web/src/api/sdf/dal/prop.ts +++ b/app/web/src/api/sdf/dal/prop.ts @@ -3,7 +3,6 @@ export type PropId = string; export enum PropKind { Array = "array", Boolean = "boolean", - Float = "float", Integer = "integer", Json = "json", Object = "object", diff --git a/app/web/src/assets/static/editor_typescript.txt b/app/web/src/assets/static/editor_typescript.txt index 90f3749403..12f316c03b 100644 --- a/app/web/src/assets/static/editor_typescript.txt +++ b/app/web/src/assets/static/editor_typescript.txt @@ -272,7 +272,7 @@ declare class PropWidgetDefinitionBuilder implements IPropWidgetDefinitionBuilde * .setOption("us-east-2 - US East (Ohio)", "us-east-2") */ addOption(key: string, value: string): this; - + /** * Set this prop as create only prop. This means that when * the component has a resource attached, it will be marked @@ -394,7 +394,6 @@ declare class SiPropValueFromDefinitionBuilder implements ISiPropValueFromDefini type PropDefinitionKind = "array" | "boolean" - | "float" | "integer" | "map" | "object" @@ -582,7 +581,7 @@ declare class PropBuilder implements IPropBuilder { /** * The type of the prop * - * @param {string} kind [array | boolean | float | integer | map | object | string] + * @param {string} kind [array | boolean | integer | map | object | string] * * @returns this * @@ -649,7 +648,7 @@ interface ISecretPropBuilder { setName(name: string): this; setSecretKind(kind: string): this; - + setConnectionAnnotation(annotation: string): this; setDocLinkRef(ref: string): this; @@ -698,7 +697,7 @@ declare class SecretPropBuilder implements ISecretPropBuilder { * .setSecretKind("DigitalOcean Credential") */ setSecretKind(kind: string): this; - + setConnectionAnnotation(annotation: string): this; setDocLinkRef(ref: string): this; diff --git a/bin/lang-js/src/asset_builder.ts b/bin/lang-js/src/asset_builder.ts index edd6992588..762c708328 100644 --- a/bin/lang-js/src/asset_builder.ts +++ b/bin/lang-js/src/asset_builder.ts @@ -518,7 +518,6 @@ export class SiPropValueFromDefinitionBuilder export type PropDefinitionKind = | "array" | "boolean" - | "float" | "integer" | "map" | "object" @@ -757,7 +756,7 @@ export class PropBuilder implements IPropBuilder { /** * The type of the prop * - * @param kind {PropDefinitionKind} [array | boolean | float | integer | map | object | string] + * @param kind {PropDefinitionKind} [array | boolean | integer | map | object | string] * * @returns this * diff --git a/lib/cyclone-core/src/resolver_function.rs b/lib/cyclone-core/src/resolver_function.rs index e433861d8c..72704f7b9d 100644 --- a/lib/cyclone-core/src/resolver_function.rs +++ b/lib/cyclone-core/src/resolver_function.rs @@ -33,7 +33,6 @@ pub enum ResolverFunctionResponseType { Array, Boolean, CodeGeneration, - Float, Identity, Integer, Json, diff --git a/lib/dal/src/attribute/value.rs b/lib/dal/src/attribute/value.rs index 229387ffad..2ce0c6ec5b 100644 --- a/lib/dal/src/attribute/value.rs +++ b/lib/dal/src/attribute/value.rs @@ -2356,11 +2356,7 @@ impl AttributeValue { ) -> AttributeValueResult> { let prop = Self::prop(ctx, id).await?; match prop.kind { - PropKind::Boolean - | PropKind::Integer - | PropKind::Float - | PropKind::Json - | PropKind::String => Ok(vec![]), + PropKind::Boolean | PropKind::Integer | PropKind::Json | PropKind::String => Ok(vec![]), PropKind::Array | PropKind::Map => { Self::get_child_av_ids_from_ordering_node(ctx, id).await } diff --git a/lib/dal/src/func.rs b/lib/dal/src/func.rs index 2307c5cff0..8adf1ce0c7 100644 --- a/lib/dal/src/func.rs +++ b/lib/dal/src/func.rs @@ -432,7 +432,6 @@ impl Func { IntrinsicFunc::SetArray | IntrinsicFunc::SetBoolean | IntrinsicFunc::SetInteger - | IntrinsicFunc::SetFloat | IntrinsicFunc::SetJson | IntrinsicFunc::SetMap | IntrinsicFunc::SetObject diff --git a/lib/dal/src/func/argument.rs b/lib/dal/src/func/argument.rs index be251aef8b..b1b19d41f8 100644 --- a/lib/dal/src/func/argument.rs +++ b/lib/dal/src/func/argument.rs @@ -83,7 +83,6 @@ pub enum FuncArgumentKind { Any, Array, Boolean, - Float, Integer, Json, Map, @@ -97,7 +96,6 @@ impl From for si_events::FuncArgumentKind { FuncArgumentKind::Any => si_events::FuncArgumentKind::Any, FuncArgumentKind::Array => si_events::FuncArgumentKind::Array, FuncArgumentKind::Boolean => si_events::FuncArgumentKind::Boolean, - FuncArgumentKind::Float => si_events::FuncArgumentKind::Float, FuncArgumentKind::Integer => si_events::FuncArgumentKind::Integer, FuncArgumentKind::Json => si_events::FuncArgumentKind::Json, FuncArgumentKind::Map => si_events::FuncArgumentKind::Map, @@ -114,7 +112,6 @@ impl From for FuncArgumentKind { PropKind::Array => FuncArgumentKind::Array, PropKind::Boolean => FuncArgumentKind::Boolean, PropKind::Integer => FuncArgumentKind::Integer, - PropKind::Float => FuncArgumentKind::Float, PropKind::Object => FuncArgumentKind::Object, PropKind::String => FuncArgumentKind::String, PropKind::Map => FuncArgumentKind::Map, @@ -129,7 +126,6 @@ impl From for FuncArgumentKind { PkgFuncArgumentKind::Json => FuncArgumentKind::Json, PkgFuncArgumentKind::Array => FuncArgumentKind::Array, PkgFuncArgumentKind::Boolean => FuncArgumentKind::Boolean, - PkgFuncArgumentKind::Float => FuncArgumentKind::Float, PkgFuncArgumentKind::Integer => FuncArgumentKind::Integer, PkgFuncArgumentKind::Map => FuncArgumentKind::Map, PkgFuncArgumentKind::Object => FuncArgumentKind::Object, @@ -144,7 +140,6 @@ impl From for PkgFuncArgumentKind { FuncArgumentKind::Any => PkgFuncArgumentKind::Any, FuncArgumentKind::Array => PkgFuncArgumentKind::Array, FuncArgumentKind::Boolean => PkgFuncArgumentKind::Boolean, - FuncArgumentKind::Float => PkgFuncArgumentKind::Float, FuncArgumentKind::Integer => PkgFuncArgumentKind::Integer, FuncArgumentKind::Map => PkgFuncArgumentKind::Map, FuncArgumentKind::Object => PkgFuncArgumentKind::Object, @@ -160,7 +155,6 @@ impl From for FuncArgumentKind { si_frontend_types::FuncArgumentKind::Any => FuncArgumentKind::Any, si_frontend_types::FuncArgumentKind::Array => FuncArgumentKind::Array, si_frontend_types::FuncArgumentKind::Boolean => FuncArgumentKind::Boolean, - si_frontend_types::FuncArgumentKind::Float => FuncArgumentKind::Float, si_frontend_types::FuncArgumentKind::Integer => FuncArgumentKind::Integer, si_frontend_types::FuncArgumentKind::Json => FuncArgumentKind::Json, si_frontend_types::FuncArgumentKind::Map => FuncArgumentKind::Map, @@ -178,7 +172,6 @@ impl From for si_frontend_types::FuncArgumentKind { FuncArgumentKind::Any => si_frontend_types::FuncArgumentKind::Any, FuncArgumentKind::Array => si_frontend_types::FuncArgumentKind::Array, FuncArgumentKind::Boolean => si_frontend_types::FuncArgumentKind::Boolean, - FuncArgumentKind::Float => si_frontend_types::FuncArgumentKind::Float, FuncArgumentKind::Integer => si_frontend_types::FuncArgumentKind::Integer, FuncArgumentKind::Json => si_frontend_types::FuncArgumentKind::Json, FuncArgumentKind::Map => si_frontend_types::FuncArgumentKind::Map, diff --git a/lib/dal/src/func/backend.rs b/lib/dal/src/func/backend.rs index 1bdad1cc29..bf167639a4 100644 --- a/lib/dal/src/func/backend.rs +++ b/lib/dal/src/func/backend.rs @@ -19,7 +19,6 @@ use crate::{Func, FuncId, PropKind}; pub mod array; pub mod boolean; pub mod diff; -pub mod float; pub mod identity; pub mod integer; pub mod js_action; @@ -86,7 +85,6 @@ pub enum FuncBackendKind { /// Comparison between two JSON values Diff, /// Mathematical identity of the [`Func`](crate::Func)'s arguments. - Float, Identity, Integer, JsAction, @@ -115,7 +113,6 @@ impl From for si_events::FuncBackendKind { FuncBackendKind::Diff => si_events::FuncBackendKind::Diff, FuncBackendKind::Identity => si_events::FuncBackendKind::Identity, FuncBackendKind::Integer => si_events::FuncBackendKind::Integer, - FuncBackendKind::Float => si_events::FuncBackendKind::Float, FuncBackendKind::JsAction => si_events::FuncBackendKind::JsAction, FuncBackendKind::JsAttribute => si_events::FuncBackendKind::JsAttribute, FuncBackendKind::JsAuthentication => si_events::FuncBackendKind::JsAuthentication, @@ -145,7 +142,6 @@ impl From for FuncBackendKind { si_events::FuncBackendKind::Array => FuncBackendKind::Array, si_events::FuncBackendKind::Boolean => FuncBackendKind::Boolean, si_events::FuncBackendKind::Diff => FuncBackendKind::Diff, - si_events::FuncBackendKind::Float => FuncBackendKind::Float, si_events::FuncBackendKind::Identity => FuncBackendKind::Identity, si_events::FuncBackendKind::Integer => FuncBackendKind::Integer, si_events::FuncBackendKind::JsAction => FuncBackendKind::JsAction, @@ -192,7 +188,6 @@ pub enum FuncBackendResponseType { Boolean, CodeGeneration, /// Mathematical identity of the [`Func`](crate::Func)'s arguments. - Float, Identity, Integer, Json, @@ -218,7 +213,6 @@ impl From for si_events::FuncBackendResponseType { FuncBackendResponseType::CodeGeneration => { si_events::FuncBackendResponseType::CodeGeneration } - FuncBackendResponseType::Float => si_events::FuncBackendResponseType::Float, FuncBackendResponseType::Identity => si_events::FuncBackendResponseType::Identity, FuncBackendResponseType::Integer => si_events::FuncBackendResponseType::Integer, FuncBackendResponseType::Json => si_events::FuncBackendResponseType::Json, @@ -251,7 +245,6 @@ impl From for FuncBackendResponseType { si_events::FuncBackendResponseType::CodeGeneration => { FuncBackendResponseType::CodeGeneration } - si_events::FuncBackendResponseType::Float => FuncBackendResponseType::Float, si_events::FuncBackendResponseType::Identity => FuncBackendResponseType::Identity, si_events::FuncBackendResponseType::Integer => FuncBackendResponseType::Integer, si_events::FuncBackendResponseType::Json => FuncBackendResponseType::Json, @@ -281,7 +274,6 @@ impl From for FuncBackendResponseType { ResolverFunctionResponseType::Action => FuncBackendResponseType::Action, ResolverFunctionResponseType::Array => FuncBackendResponseType::Array, ResolverFunctionResponseType::Boolean => FuncBackendResponseType::Boolean, - ResolverFunctionResponseType::Float => FuncBackendResponseType::Float, ResolverFunctionResponseType::Identity => FuncBackendResponseType::Identity, ResolverFunctionResponseType::Integer => FuncBackendResponseType::Integer, ResolverFunctionResponseType::Map => FuncBackendResponseType::Map, @@ -309,7 +301,6 @@ impl TryFrom for ResolverFunctionResponseType { FuncBackendResponseType::Action => ResolverFunctionResponseType::Action, FuncBackendResponseType::Array => ResolverFunctionResponseType::Array, FuncBackendResponseType::Boolean => ResolverFunctionResponseType::Boolean, - FuncBackendResponseType::Float => ResolverFunctionResponseType::Float, FuncBackendResponseType::Integer => ResolverFunctionResponseType::Integer, FuncBackendResponseType::Identity => ResolverFunctionResponseType::Identity, FuncBackendResponseType::Map => ResolverFunctionResponseType::Map, diff --git a/lib/dal/src/func/backend/array.rs b/lib/dal/src/func/backend/array.rs index 1f60dd672d..f9aed0ca2e 100644 --- a/lib/dal/src/func/backend/array.rs +++ b/lib/dal/src/func/backend/array.rs @@ -42,8 +42,6 @@ impl FuncBackend for FuncBackendArray { PropKind::Array } else if entry.is_i64() { PropKind::Integer - } else if entry.is_f64() { - PropKind::Float } else if entry.is_object() { PropKind::Object } else if entry.is_boolean() { diff --git a/lib/dal/src/func/backend/float.rs b/lib/dal/src/func/backend/float.rs deleted file mode 100644 index 53dad062d4..0000000000 --- a/lib/dal/src/func/backend/float.rs +++ /dev/null @@ -1,36 +0,0 @@ -use async_trait::async_trait; -use serde::{Deserialize, Serialize}; - -use crate::func::backend::{FuncBackend, FuncBackendResult}; - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct FuncBackendFloatArgs { - pub value: f64, -} - -impl FuncBackendFloatArgs { - pub fn new(value: f64) -> Self { - Self { value } - } -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct FuncBackendFloat { - args: FuncBackendFloatArgs, -} - -#[async_trait] -impl FuncBackend for FuncBackendFloat { - type Args = FuncBackendFloatArgs; - - fn new(args: Self::Args) -> Box { - Box::new(Self { args }) - } - - async fn inline( - self: Box, - ) -> FuncBackendResult<(Option, Option)> { - let value = serde_json::to_value(self.args.value)?; - Ok((Some(value.clone()), Some(value))) - } -} diff --git a/lib/dal/src/func/backend/js_attribute.rs b/lib/dal/src/func/backend/js_attribute.rs index 945818b829..9ca8a95816 100644 --- a/lib/dal/src/func/backend/js_attribute.rs +++ b/lib/dal/src/func/backend/js_attribute.rs @@ -60,7 +60,6 @@ impl FuncDispatch for FuncBackendJsAttribute { | ResolverFunctionResponseType::Array | ResolverFunctionResponseType::Boolean | ResolverFunctionResponseType::Integer - | ResolverFunctionResponseType::Float | ResolverFunctionResponseType::Identity | ResolverFunctionResponseType::Map | ResolverFunctionResponseType::Object diff --git a/lib/dal/src/func/binding/attribute.rs b/lib/dal/src/func/binding/attribute.rs index 75fbd60df0..83ade54ecd 100644 --- a/lib/dal/src/func/binding/attribute.rs +++ b/lib/dal/src/func/binding/attribute.rs @@ -904,7 +904,6 @@ async fn validate_intrinsic_inputs( IntrinsicFunc::SetArray | IntrinsicFunc::SetBoolean | IntrinsicFunc::SetInteger - | IntrinsicFunc::SetFloat | IntrinsicFunc::SetJson | IntrinsicFunc::SetMap | IntrinsicFunc::SetObject diff --git a/lib/dal/src/func/intrinsics.rs b/lib/dal/src/func/intrinsics.rs index 239bfe9fb7..017c3cbd3d 100644 --- a/lib/dal/src/func/intrinsics.rs +++ b/lib/dal/src/func/intrinsics.rs @@ -16,7 +16,6 @@ pub enum IntrinsicFunc { ResourcePayloadToValue, SetArray, SetBoolean, - SetFloat, SetInteger, SetJson, SetMap, @@ -134,19 +133,6 @@ impl IntrinsicFunc { .map_err(FuncError::IntrinsicSpecCreation)?, ); } - Self::SetFloat => { - builder - .unique_id("ab9875b8d5987e3f41e9d5a3c2cc00896338d89b084ca570fa22202c8da0ec55"); - data_builder.backend_kind(FuncSpecBackendKind::Float); - data_builder.response_type(FuncSpecBackendResponseType::Float); - builder.argument( - FuncArgumentSpec::builder() - .name("value") - .kind(FuncArgumentKind::Float) - .build() - .map_err(FuncError::IntrinsicSpecCreation)?, - ); - } Self::SetMap => { builder .unique_id("dea5084fbf6e7fe8328ac725852b96f4b5869b14d0fe9dd63a285fa876772496"); @@ -239,7 +225,6 @@ impl IntrinsicFunc { Self::SetArray => "si:setArray", Self::SetBoolean => "si:setBoolean", Self::SetInteger => "si:setInteger", - Self::SetFloat => "si:setFloat", Self::SetMap => "si:setMap", Self::SetObject => "si:setObject", Self::SetJson => "si:setJson", @@ -257,7 +242,6 @@ impl IntrinsicFunc { "si:setArray" => Self::SetArray, "si:setBoolean" => Self::SetBoolean, "si:setInteger" => Self::SetInteger, - "si:setFloat" => Self::SetFloat, "si:setMap" => Self::SetMap, "si:setObject" => Self::SetObject, "si:setJson" => Self::SetJson, @@ -277,7 +261,6 @@ impl From for IntrinsicFunc { PropKind::Array => IntrinsicFunc::SetArray, PropKind::Boolean => IntrinsicFunc::SetBoolean, PropKind::Integer => IntrinsicFunc::SetInteger, - PropKind::Float => IntrinsicFunc::SetFloat, PropKind::Json => IntrinsicFunc::SetJson, PropKind::Map => IntrinsicFunc::SetMap, PropKind::Object => IntrinsicFunc::SetObject, diff --git a/lib/dal/src/func/kind.rs b/lib/dal/src/func/kind.rs index bb0641d811..91386bde8e 100644 --- a/lib/dal/src/func/kind.rs +++ b/lib/dal/src/func/kind.rs @@ -74,7 +74,6 @@ impl FuncKind { | FuncBackendKind::Boolean | FuncBackendKind::Diff | FuncBackendKind::Identity - | FuncBackendKind::Float | FuncBackendKind::Integer | FuncBackendKind::Map | FuncBackendKind::NormalizeToArray diff --git a/lib/dal/src/func/runner.rs b/lib/dal/src/func/runner.rs index d91170a7fb..0d54d5d13e 100644 --- a/lib/dal/src/func/runner.rs +++ b/lib/dal/src/func/runner.rs @@ -42,7 +42,6 @@ use crate::{ }; use crate::{HistoryEventError, TransactionsError}; -use super::backend::float::FuncBackendFloat; use super::backend::management::FuncBackendManagement; use super::backend::normalize_to_array::FuncBackendNormalizeToArray; use super::backend::resource_payload_to_value::FuncBackendResourcePayloadToValue; @@ -1734,7 +1733,6 @@ impl FuncRunnerExecutionTask { FuncBackendKind::Boolean => FuncBackendBoolean::create_and_execute(&self.args).await, FuncBackendKind::Identity => FuncBackendIdentity::create_and_execute(&self.args).await, FuncBackendKind::Diff => FuncBackendDiff::create_and_execute(&self.args).await, - FuncBackendKind::Float => FuncBackendFloat::create_and_execute(&self.args).await, FuncBackendKind::Integer => FuncBackendInteger::create_and_execute(&self.args).await, FuncBackendKind::Map => FuncBackendMap::create_and_execute(&self.args).await, FuncBackendKind::Object => FuncBackendObject::create_and_execute(&self.args).await, diff --git a/lib/dal/src/management/mod.rs b/lib/dal/src/management/mod.rs index 06e9d825d4..52ae1c1f68 100644 --- a/lib/dal/src/management/mod.rs +++ b/lib/dal/src/management/mod.rs @@ -1738,11 +1738,7 @@ async fn update_component( let prop = Prop::get_by_id(ctx, prop_id).await?; match prop.kind { - PropKind::String - | PropKind::Boolean - | PropKind::Integer - | PropKind::Float - | PropKind::Json => { + PropKind::String | PropKind::Boolean | PropKind::Integer | PropKind::Json => { // todo: type check! let view = AttributeValue::get_by_id(ctx, path_attribute_value_id) .await? diff --git a/lib/dal/src/pkg.rs b/lib/dal/src/pkg.rs index 3607b87a3b..2d4c1a5d7a 100644 --- a/lib/dal/src/pkg.rs +++ b/lib/dal/src/pkg.rs @@ -140,7 +140,6 @@ impl From for FuncSpecBackendKind { FuncBackendKind::Array => Self::Array, FuncBackendKind::Boolean => Self::Boolean, FuncBackendKind::Diff => Self::Diff, - FuncBackendKind::Float => Self::Float, FuncBackendKind::Identity => Self::Identity, FuncBackendKind::Integer => Self::Integer, FuncBackendKind::JsAction => Self::JsAction, @@ -168,7 +167,6 @@ impl From for FuncBackendKind { FuncSpecBackendKind::Array => Self::Array, FuncSpecBackendKind::Boolean => Self::Boolean, FuncSpecBackendKind::Diff => Self::Diff, - FuncSpecBackendKind::Float => Self::Float, FuncSpecBackendKind::Identity => Self::Identity, FuncSpecBackendKind::Integer => Self::Integer, FuncSpecBackendKind::JsAction => Self::JsAction, @@ -197,7 +195,6 @@ impl From for FuncSpecBackendResponseType { FuncBackendResponseType::Array => Self::Array, FuncBackendResponseType::Boolean => Self::Boolean, FuncBackendResponseType::CodeGeneration => Self::CodeGeneration, - FuncBackendResponseType::Float => Self::Float, FuncBackendResponseType::Identity => Self::Identity, FuncBackendResponseType::Integer => Self::Integer, FuncBackendResponseType::Json => Self::Json, @@ -222,7 +219,6 @@ impl From for FuncBackendResponseType { FuncSpecBackendResponseType::Array => Self::Array, FuncSpecBackendResponseType::Boolean => Self::Boolean, FuncSpecBackendResponseType::CodeGeneration => Self::CodeGeneration, - FuncSpecBackendResponseType::Float => Self::Float, FuncSpecBackendResponseType::Identity => Self::Identity, FuncSpecBackendResponseType::Integer => Self::Integer, FuncSpecBackendResponseType::Json => Self::Json, diff --git a/lib/dal/src/pkg/export.rs b/lib/dal/src/pkg/export.rs index 24512439c6..f450739057 100644 --- a/lib/dal/src/pkg/export.rs +++ b/lib/dal/src/pkg/export.rs @@ -646,7 +646,6 @@ impl PkgExporter { PropKind::Array => PropSpecKind::Array, PropKind::Boolean => PropSpecKind::Boolean, PropKind::Integer => PropSpecKind::Number, - PropKind::Float => PropSpecKind::Float, PropKind::Object => PropSpecKind::Object, PropKind::String => PropSpecKind::String, PropKind::Map => PropSpecKind::Map, @@ -722,7 +721,6 @@ impl PkgExporter { PropSpecKind::Json | PropSpecKind::String | PropSpecKind::Number - | PropSpecKind::Float | PropSpecKind::Boolean => { return Err(PkgError::PropSpecChildrenInvalid(format!( "primitve prop type should have no children for prop id {}", diff --git a/lib/dal/src/pkg/import.rs b/lib/dal/src/pkg/import.rs index a34d26e91a..c1f305ab3c 100644 --- a/lib/dal/src/pkg/import.rs +++ b/lib/dal/src/pkg/import.rs @@ -1676,7 +1676,6 @@ fn prop_kind_for_pkg_prop(pkg_prop: &SiPkgProp<'_>) -> PropKind { SiPkgProp::Json { .. } => PropKind::Json, SiPkgProp::Map { .. } => PropKind::Map, SiPkgProp::Number { .. } => PropKind::Integer, - SiPkgProp::Float { .. } => PropKind::Float, SiPkgProp::Object { .. } => PropKind::Object, SiPkgProp::String { .. } => PropKind::String, } diff --git a/lib/dal/src/prop.rs b/lib/dal/src/prop.rs index d184778f82..c17b3b51e7 100644 --- a/lib/dal/src/prop.rs +++ b/lib/dal/src/prop.rs @@ -272,7 +272,6 @@ pub enum PropKind { Map, Object, String, - Float, } impl From for si_frontend_types::PropKind { @@ -280,7 +279,6 @@ impl From for si_frontend_types::PropKind { match value { PropKind::Array => si_frontend_types::PropKind::Array, PropKind::Boolean => si_frontend_types::PropKind::Boolean, - PropKind::Float => si_frontend_types::PropKind::Float, PropKind::Integer => si_frontend_types::PropKind::Integer, PropKind::Json => si_frontend_types::PropKind::Json, PropKind::Map => si_frontend_types::PropKind::Map, @@ -310,7 +308,7 @@ impl PropKind { pub fn is_scalar(&self) -> bool { matches!( self, - PropKind::String | PropKind::Boolean | PropKind::Integer | PropKind::Float + PropKind::String | PropKind::Boolean | PropKind::Integer ) } } @@ -322,7 +320,6 @@ impl From for PropSpecKind { PropKind::Boolean => Self::Boolean, PropKind::String => Self::String, PropKind::Integer => Self::Number, - PropKind::Float => Self::Float, PropKind::Json => PropSpecKind::Json, PropKind::Object => Self::Object, PropKind::Map => Self::Map, @@ -337,7 +334,7 @@ impl From for WidgetKind { match prop { PropKind::Array => Self::Array, PropKind::Boolean => Self::Checkbox, - PropKind::Json | PropKind::String | PropKind::Integer | PropKind::Float => Self::Text, + PropKind::Json | PropKind::String | PropKind::Integer => Self::Text, PropKind::Object => Self::Header, PropKind::Map => Self::Map, } @@ -350,7 +347,6 @@ impl From for FuncBackendResponseType { PropKind::Array => Self::Array, PropKind::Boolean => Self::Boolean, PropKind::Integer => Self::Integer, - PropKind::Float => Self::Float, PropKind::Object => Self::Object, PropKind::Json => Self::Json, PropKind::Map => Self::Map, @@ -1144,7 +1140,6 @@ impl Prop { Ok(match self.kind { PropKind::Boolean => "boolean".to_string(), - PropKind::Float => "float".to_string(), PropKind::Integer => "number".to_string(), PropKind::String => "string".to_string(), PropKind::Array => { diff --git a/lib/dal/src/property_editor/schema.rs b/lib/dal/src/property_editor/schema.rs index e52c6ff1e4..579a9eef4e 100644 --- a/lib/dal/src/property_editor/schema.rs +++ b/lib/dal/src/property_editor/schema.rs @@ -189,7 +189,6 @@ pub struct PropertyEditorProp { pub enum PropertyEditorPropKind { Array, Boolean, - Float, Integer, Json, Map, @@ -202,7 +201,6 @@ impl From for PropertyEditorPropKind { match prop_kind { PropKind::Array => Self::Array, PropKind::Boolean => Self::Boolean, - PropKind::Float => Self::Float, PropKind::Integer => Self::Integer, PropKind::Json => Self::Json, PropKind::Object => Self::Object, diff --git a/lib/dal/src/schema/variant.rs b/lib/dal/src/schema/variant.rs index fab5d822cd..2d045d9462 100644 --- a/lib/dal/src/schema/variant.rs +++ b/lib/dal/src/schema/variant.rs @@ -1891,7 +1891,6 @@ impl SchemaVariant { IntrinsicFunc::SetArray | IntrinsicFunc::SetBoolean | IntrinsicFunc::SetInteger - | IntrinsicFunc::SetFloat | IntrinsicFunc::SetJson | IntrinsicFunc::SetMap | IntrinsicFunc::SetObject diff --git a/lib/dal/tests/integration_test/func/authoring/binding.rs b/lib/dal/tests/integration_test/func/authoring/binding.rs index e41e0c2872..be496a87be 100644 --- a/lib/dal/tests/integration_test/func/authoring/binding.rs +++ b/lib/dal/tests/integration_test/func/authoring/binding.rs @@ -907,7 +907,6 @@ async fn return_the_right_bindings(ctx: &mut DalContext, nw: &WorkspaceSignup) { | IntrinsicFunc::SetBoolean | IntrinsicFunc::SetInteger | IntrinsicFunc::SetJson - | IntrinsicFunc::SetFloat | IntrinsicFunc::SetMap | IntrinsicFunc::SetObject | IntrinsicFunc::SetString @@ -967,7 +966,6 @@ async fn return_the_right_bindings(ctx: &mut DalContext, nw: &WorkspaceSignup) { // these intrinsics only have one arg IntrinsicFunc::SetArray | IntrinsicFunc::SetBoolean - | IntrinsicFunc::SetFloat | IntrinsicFunc::SetInteger | IntrinsicFunc::SetJson | IntrinsicFunc::SetMap diff --git a/lib/dal/tests/integration_test/module.rs b/lib/dal/tests/integration_test/module.rs index a8d32ce6e7..d60e71d321 100644 --- a/lib/dal/tests/integration_test/module.rs +++ b/lib/dal/tests/integration_test/module.rs @@ -103,7 +103,7 @@ async fn module_export_simple(ctx: &mut DalContext) { assert_eq!(exported_pkg.name, name.clone()); assert_eq!(exported_pkg.version, version.clone()); assert_eq!(exported_pkg.created_by, user.clone()); - assert_eq!(exported_pkg.funcs.len(), 16); + assert_eq!(exported_pkg.funcs.len(), 15); let pkg_schemas = exported_pkg.clone().schemas; assert_eq!(pkg_schemas.len(), 1); @@ -153,7 +153,6 @@ async fn module_export_simple(ctx: &mut DalContext) { "si:resourcePayloadToValue".to_string(), "si:setArray".to_string(), "si:setBoolean".to_string(), - "si:setFloat".to_string(), "si:setInteger".to_string(), "si:setJson".to_string(), "si:setMap".to_string(), diff --git a/lib/si-events-rs/src/func_run.rs b/lib/si-events-rs/src/func_run.rs index 0c36551cf6..40266c2733 100644 --- a/lib/si-events-rs/src/func_run.rs +++ b/lib/si-events-rs/src/func_run.rs @@ -55,7 +55,6 @@ pub enum FuncArgumentKind { Map, Object, String, - Float, } // NOTE(nick,zack): do not add "remain::sorted" for postcard de/ser. We need the order to be @@ -79,7 +78,6 @@ pub enum FuncBackendKind { /// Comparison between two JSON values Diff, /// Mathematical identity of the [`Func`](crate::Func)'s arguments. - Float, Identity, Integer, JsAction, @@ -121,7 +119,6 @@ pub enum FuncBackendResponseType { Boolean, CodeGeneration, /// Mathematical identity of the [`Func`](crate::Func)'s arguments. - Float, Identity, Integer, Json, diff --git a/lib/si-frontend-types-rs/src/func.rs b/lib/si-frontend-types-rs/src/func.rs index a01f986bf2..3703445dd8 100644 --- a/lib/si-frontend-types-rs/src/func.rs +++ b/lib/si-frontend-types-rs/src/func.rs @@ -227,7 +227,6 @@ pub enum FuncArgumentKind { Any, Array, Boolean, - Float, Integer, Json, Map, diff --git a/lib/si-frontend-types-rs/src/schema_variant.rs b/lib/si-frontend-types-rs/src/schema_variant.rs index 1995e8b145..b76a174515 100644 --- a/lib/si-frontend-types-rs/src/schema_variant.rs +++ b/lib/si-frontend-types-rs/src/schema_variant.rs @@ -108,7 +108,6 @@ pub enum PropKind { Any, Array, Boolean, - Float, Integer, Json, Map, diff --git a/lib/si-pkg/src/node/prop.rs b/lib/si-pkg/src/node/prop.rs index 65f2906977..e9de932c71 100644 --- a/lib/si-pkg/src/node/prop.rs +++ b/lib/si-pkg/src/node/prop.rs @@ -29,7 +29,6 @@ const KEY_UNIQUE_ID_STR: &str = "unique_id"; const PROP_TY_STRING: &str = "string"; const PROP_TY_JSON: &str = "json"; const PROP_TY_INTEGER: &str = "integer"; -const PROP_TY_FLOAT: &str = "float"; const PROP_TY_BOOLEAN: &str = "boolean"; const PROP_TY_MAP: &str = "map"; const PROP_TY_ARRAY: &str = "array"; @@ -61,11 +60,6 @@ pub enum PropNode { data: Option, unique_id: Option, }, - Float { - name: String, - data: Option, - unique_id: Option, - }, Integer { name: String, data: Option, @@ -98,7 +92,6 @@ impl PropNode { match self { Self::String { .. } => PROP_TY_STRING, Self::Json { .. } => PROP_TY_JSON, - Self::Float { .. } => PROP_TY_FLOAT, Self::Integer { .. } => PROP_TY_INTEGER, Self::Boolean { .. } => PROP_TY_BOOLEAN, Self::Map { .. } => PROP_TY_MAP, @@ -113,7 +106,6 @@ impl NameStr for PropNode { match self { Self::String { name, .. } | Self::Json { name, .. } - | Self::Float { name, .. } | Self::Integer { name, .. } | Self::Boolean { name, .. } | Self::Map { name, .. } @@ -131,7 +123,6 @@ impl WriteBytes for PropNode { if let Some(data) = match &self { Self::String { data, .. } | Self::Json { data, .. } - | Self::Float { data, .. } | Self::Integer { data, .. } | Self::Boolean { data, .. } | Self::Map { data, .. } @@ -185,7 +176,6 @@ impl WriteBytes for PropNode { if let Some(unique_id) = match &self { Self::String { unique_id, .. } - | Self::Float { unique_id, .. } | Self::Integer { unique_id, .. } | Self::Json { unique_id, .. } | Self::Boolean { unique_id, .. } @@ -279,11 +269,6 @@ impl ReadBytes for PropNode { data, unique_id, }, - PROP_TY_FLOAT => Self::Float { - name, - data, - unique_id, - }, PROP_TY_BOOLEAN => Self::Boolean { name, data, @@ -347,11 +332,6 @@ impl NodeChild for PropSpec { data, unique_id, } - | Self::Float { - name, - data, - unique_id, - } | Self::Object { name, data, @@ -430,18 +410,6 @@ impl NodeChild for PropSpec { )) as Box>], ), - Self::Float { .. } => NodeWithChildren::new( - NodeKind::Tree, - Self::NodeType::Prop(PropNode::Float { - name, - data, - unique_id, - }), - vec![Box::new(PropChild::AttrFuncInputs( - inputs.to_owned().unwrap_or(vec![]), - )) - as Box>], - ), Self::Boolean { .. } => NodeWithChildren::new( NodeKind::Tree, Self::NodeType::Prop(PropNode::Boolean { diff --git a/lib/si-pkg/src/pkg/prop.rs b/lib/si-pkg/src/pkg/prop.rs index a426b043a0..b52321eb92 100644 --- a/lib/si-pkg/src/pkg/prop.rs +++ b/lib/si-pkg/src/pkg/prop.rs @@ -39,13 +39,6 @@ pub enum SiPkgProp<'a> { hash: Hash, source: Source<'a>, }, - Float { - name: String, - data: Option, - unique_id: Option, - hash: Hash, - source: Source<'a>, - }, Json { name: String, data: Option, @@ -92,7 +85,6 @@ macro_rules! impl_prop_child_from_graph { | SiPkgProp::Json { source, .. } | SiPkgProp::String { source, .. } | SiPkgProp::Number { source, .. } - | SiPkgProp::Float { source, .. } | SiPkgProp::Object { source, .. } | SiPkgProp::Boolean { source, .. } => { let mut entries = vec![]; @@ -166,11 +158,6 @@ impl<'a> SiPkgProp<'a> { data, unique_id, } - | PropNode::Float { - name, - data, - unique_id, - } | PropNode::Integer { name, data, @@ -231,14 +218,6 @@ impl<'a> SiPkgProp<'a> { hash, source, }, - PropNode::Float { .. } => Self::Float { - name, - data, - unique_id, - - hash, - source, - }, PropNode::Json { .. } => Self::Json { name, data, @@ -289,7 +268,6 @@ impl<'a> SiPkgProp<'a> { | SiPkgProp::Json { data, .. } | SiPkgProp::Map { data, .. } | SiPkgProp::Number { data, .. } - | SiPkgProp::Float { data, .. } | SiPkgProp::Object { data, .. } | SiPkgProp::String { data, .. } => data.as_ref(), } @@ -301,7 +279,6 @@ impl<'a> SiPkgProp<'a> { | SiPkgProp::Boolean { unique_id, .. } | SiPkgProp::Json { unique_id, .. } | SiPkgProp::Map { unique_id, .. } - | SiPkgProp::Float { unique_id, .. } | SiPkgProp::Number { unique_id, .. } | SiPkgProp::Object { unique_id, .. } | SiPkgProp::String { unique_id, .. } => unique_id.as_deref(), @@ -312,7 +289,6 @@ impl<'a> SiPkgProp<'a> { match self { Self::String { name, .. } | Self::Number { name, .. } - | Self::Float { name, .. } | Self::Json { name, .. } | Self::Boolean { name, .. } | Self::Map { name, .. } @@ -325,7 +301,6 @@ impl<'a> SiPkgProp<'a> { match self { Self::String { hash, .. } | Self::Number { hash, .. } - | Self::Float { hash, .. } | Self::Json { hash, .. } | Self::Boolean { hash, .. } | Self::Map { hash, .. } @@ -339,7 +314,6 @@ impl<'a> SiPkgProp<'a> { Self::String { source, .. } | Self::Json { source, .. } | Self::Number { source, .. } - | Self::Float { source, .. } | Self::Boolean { source, .. } | Self::Map { source, .. } | Self::Array { source, .. } diff --git a/lib/si-pkg/src/pkg/variant.rs b/lib/si-pkg/src/pkg/variant.rs index 9d1cd3bc81..91ac5b723f 100644 --- a/lib/si-pkg/src/pkg/variant.rs +++ b/lib/si-pkg/src/pkg/variant.rs @@ -519,12 +519,6 @@ async fn create_prop_stack( builder.default_value(dv); } } - SiPkgProp::Float { .. } => { - builder.kind(PropSpecKind::Float); - if let Some(dv) = default_value { - builder.default_value(dv); - } - } SiPkgProp::Object { .. } => { builder.kind(PropSpecKind::Object); } @@ -545,7 +539,6 @@ async fn create_prop_stack( | SiPkgProp::Map { name, data, .. } | SiPkgProp::Array { name, data, .. } | SiPkgProp::Number { name, data, .. } - | SiPkgProp::Float { name, data, .. } | SiPkgProp::Object { name, data, .. } | SiPkgProp::Boolean { name, data, .. } => { builder.name(name); diff --git a/lib/si-pkg/src/spec/func.rs b/lib/si-pkg/src/spec/func.rs index 122d179b0a..abc23aa072 100644 --- a/lib/si-pkg/src/spec/func.rs +++ b/lib/si-pkg/src/spec/func.rs @@ -26,7 +26,6 @@ pub enum FuncArgumentKind { Any, Array, Boolean, - Float, Integer, Json, Map, @@ -65,7 +64,6 @@ pub enum FuncSpecBackendKind { Array, Boolean, Diff, - Float, Identity, Integer, JsAction, @@ -95,7 +93,6 @@ pub enum FuncSpecBackendResponseType { Array, Boolean, CodeGeneration, - Float, Identity, Integer, Json, diff --git a/lib/si-pkg/src/spec/prop.rs b/lib/si-pkg/src/spec/prop.rs index b444b6b23a..1d2400f82b 100644 --- a/lib/si-pkg/src/spec/prop.rs +++ b/lib/si-pkg/src/spec/prop.rs @@ -44,10 +44,7 @@ impl From<&PropSpec> for PropSpecWidgetKind { match node { PropSpec::Array { .. } => Self::Array, PropSpec::Boolean { .. } => Self::Checkbox, - PropSpec::String { .. } - | PropSpec::Number { .. } - | PropSpec::Float { .. } - | PropSpec::Json { .. } => Self::Text, + PropSpec::String { .. } | PropSpec::Number { .. } | PropSpec::Json { .. } => Self::Text, PropSpec::Object { .. } => Self::Header, PropSpec::Map { .. } => Self::Map, } @@ -87,12 +84,6 @@ pub enum PropSpec { unique_id: Option, }, #[serde(rename_all = "camelCase")] - Float { - name: String, - data: Option, - unique_id: Option, - }, - #[serde(rename_all = "camelCase")] Json { name: String, data: Option, @@ -226,7 +217,6 @@ impl PropSpec { | Self::Map { name, .. } | Self::Json { name, .. } | Self::Number { name, .. } - | Self::Float { name, .. } | Self::Object { name, .. } | Self::String { name, .. } => name.as_str(), } @@ -239,7 +229,6 @@ impl PropSpec { Self::Json { .. } => PropSpecKind::Json, Self::Map { .. } => PropSpecKind::Map, Self::Number { .. } => PropSpecKind::Number, - Self::Float { .. } => PropSpecKind::Float, Self::Object { .. } => PropSpecKind::Object, Self::String { .. } => PropSpecKind::String, } @@ -251,7 +240,6 @@ impl PropSpec { | Self::Boolean { data, .. } | Self::Map { data, .. } | Self::Number { data, .. } - | Self::Float { data, .. } | Self::Object { data, .. } | Self::Json { data, .. } | Self::String { data, .. } => data.as_ref(), @@ -272,7 +260,6 @@ impl PropSpec { Self::Json { .. } | Self::Boolean { .. } | Self::Number { .. } - | Self::Float { .. } | Self::String { .. } => vec![], Self::Object { entries, .. } => entries.iter().collect(), Self::Map { type_prop, .. } | Self::Array { type_prop, .. } => vec![type_prop.as_ref()], @@ -488,7 +475,6 @@ impl PropSpec { pub enum PropSpecKind { Array, Boolean, - Float, Json, Map, Number, @@ -710,11 +696,6 @@ impl PropSpecBuilder { unique_id: self.unique_id.to_owned(), data: maybe_data, }, - PropSpecKind::Float => PropSpec::Float { - name: name.to_owned(), - unique_id: self.unique_id.to_owned(), - data: maybe_data, - }, PropSpecKind::Boolean => PropSpec::Boolean { name: name.to_owned(), unique_id: self.unique_id.to_owned(),