Skip to content

Commit

Permalink
Merge pull request #5512 from systeminit/revert-5504-feat-dal-add-set…
Browse files Browse the repository at this point in the history
…-float

Revert "feat(dal): Add support for Float backend type"
  • Loading branch information
stack72 authored Feb 19, 2025
2 parents b66d6df + e53aff5 commit f8b124c
Show file tree
Hide file tree
Showing 33 changed files with 11 additions and 212 deletions.
2 changes: 0 additions & 2 deletions app/web/src/api/sdf/dal/func.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export const isCustomizableFuncKind = (f: FuncKind) =>
export enum FuncArgumentKind {
Array = "array",
Boolean = "boolean",
Float = "float",
Integer = "integer",
Json = "json",
Object = "object",
Expand All @@ -113,7 +112,6 @@ export enum FuncBackendKind {
Boolean = "Boolean",
Diff = "Diff",
Identity = "Identity",
Float = "Float",
Integer = "Integer",
JsAction = "JsAction",
JsAttribute = "JsAction",
Expand Down
1 change: 0 additions & 1 deletion app/web/src/api/sdf/dal/prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export type PropId = string;
export enum PropKind {
Array = "array",
Boolean = "boolean",
Float = "float",
Integer = "integer",
Json = "json",
Object = "object",
Expand Down
9 changes: 4 additions & 5 deletions app/web/src/assets/static/editor_typescript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -394,7 +394,6 @@ declare class SiPropValueFromDefinitionBuilder implements ISiPropValueFromDefini
type PropDefinitionKind =
"array"
| "boolean"
| "float"
| "integer"
| "map"
| "object"
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -649,7 +648,7 @@ interface ISecretPropBuilder {
setName(name: string): this;

setSecretKind(kind: string): this;

setConnectionAnnotation(annotation: string): this;

setDocLinkRef(ref: string): this;
Expand Down Expand Up @@ -698,7 +697,7 @@ declare class SecretPropBuilder implements ISecretPropBuilder {
* .setSecretKind("DigitalOcean Credential")
*/
setSecretKind(kind: string): this;

setConnectionAnnotation(annotation: string): this;

setDocLinkRef(ref: string): this;
Expand Down
3 changes: 1 addition & 2 deletions bin/lang-js/src/asset_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ export class SiPropValueFromDefinitionBuilder
export type PropDefinitionKind =
| "array"
| "boolean"
| "float"
| "integer"
| "map"
| "object"
Expand Down Expand Up @@ -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
*
Expand Down
1 change: 0 additions & 1 deletion lib/cyclone-core/src/resolver_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub enum ResolverFunctionResponseType {
Array,
Boolean,
CodeGeneration,
Float,
Identity,
Integer,
Json,
Expand Down
6 changes: 1 addition & 5 deletions lib/dal/src/attribute/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2356,11 +2356,7 @@ impl AttributeValue {
) -> AttributeValueResult<Vec<AttributeValueId>> {
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
}
Expand Down
1 change: 0 additions & 1 deletion lib/dal/src/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ impl Func {
IntrinsicFunc::SetArray
| IntrinsicFunc::SetBoolean
| IntrinsicFunc::SetInteger
| IntrinsicFunc::SetFloat
| IntrinsicFunc::SetJson
| IntrinsicFunc::SetMap
| IntrinsicFunc::SetObject
Expand Down
7 changes: 0 additions & 7 deletions lib/dal/src/func/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ pub enum FuncArgumentKind {
Any,
Array,
Boolean,
Float,
Integer,
Json,
Map,
Expand All @@ -97,7 +96,6 @@ impl From<FuncArgumentKind> 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,
Expand All @@ -114,7 +112,6 @@ impl From<PropKind> 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,
Expand All @@ -129,7 +126,6 @@ impl From<PkgFuncArgumentKind> 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,
Expand All @@ -144,7 +140,6 @@ impl From<FuncArgumentKind> 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,
Expand All @@ -160,7 +155,6 @@ impl From<si_frontend_types::FuncArgumentKind> 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,
Expand All @@ -178,7 +172,6 @@ impl From<FuncArgumentKind> 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,
Expand Down
9 changes: 0 additions & 9 deletions lib/dal/src/func/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -115,7 +113,6 @@ impl From<FuncBackendKind> 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,
Expand Down Expand Up @@ -145,7 +142,6 @@ impl From<si_events::FuncBackendKind> 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,
Expand Down Expand Up @@ -192,7 +188,6 @@ pub enum FuncBackendResponseType {
Boolean,
CodeGeneration,
/// Mathematical identity of the [`Func`](crate::Func)'s arguments.
Float,
Identity,
Integer,
Json,
Expand All @@ -218,7 +213,6 @@ impl From<FuncBackendResponseType> 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,
Expand Down Expand Up @@ -251,7 +245,6 @@ impl From<si_events::FuncBackendResponseType> 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,
Expand Down Expand Up @@ -281,7 +274,6 @@ impl From<ResolverFunctionResponseType> 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,
Expand Down Expand Up @@ -309,7 +301,6 @@ impl TryFrom<FuncBackendResponseType> 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,
Expand Down
2 changes: 0 additions & 2 deletions lib/dal/src/func/backend/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
36 changes: 0 additions & 36 deletions lib/dal/src/func/backend/float.rs

This file was deleted.

1 change: 0 additions & 1 deletion lib/dal/src/func/backend/js_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ impl FuncDispatch for FuncBackendJsAttribute {
| ResolverFunctionResponseType::Array
| ResolverFunctionResponseType::Boolean
| ResolverFunctionResponseType::Integer
| ResolverFunctionResponseType::Float
| ResolverFunctionResponseType::Identity
| ResolverFunctionResponseType::Map
| ResolverFunctionResponseType::Object
Expand Down
1 change: 0 additions & 1 deletion lib/dal/src/func/binding/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,6 @@ async fn validate_intrinsic_inputs(
IntrinsicFunc::SetArray
| IntrinsicFunc::SetBoolean
| IntrinsicFunc::SetInteger
| IntrinsicFunc::SetFloat
| IntrinsicFunc::SetJson
| IntrinsicFunc::SetMap
| IntrinsicFunc::SetObject
Expand Down
17 changes: 0 additions & 17 deletions lib/dal/src/func/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub enum IntrinsicFunc {
ResourcePayloadToValue,
SetArray,
SetBoolean,
SetFloat,
SetInteger,
SetJson,
SetMap,
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -277,7 +261,6 @@ impl From<PropKind> 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,
Expand Down
1 change: 0 additions & 1 deletion lib/dal/src/func/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl FuncKind {
| FuncBackendKind::Boolean
| FuncBackendKind::Diff
| FuncBackendKind::Identity
| FuncBackendKind::Float
| FuncBackendKind::Integer
| FuncBackendKind::Map
| FuncBackendKind::NormalizeToArray
Expand Down
2 changes: 0 additions & 2 deletions lib/dal/src/func/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions lib/dal/src/management/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Loading

0 comments on commit f8b124c

Please sign in to comment.