Skip to content

Commit

Permalink
fix(engine):change type of sheet_name from Expr to String
Browse files Browse the repository at this point in the history
  • Loading branch information
soma00333 committed Oct 14, 2024
1 parent 741f85d commit 917cd44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engine/docs/mdbook/src/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ Writes features to a file
"sheetName": {
"anyOf": [
{
"$ref": "#/definitions/Expr"
"type": "string"
},
{
"type": "null"
Expand Down
8 changes: 4 additions & 4 deletions engine/runtime/action-sink/src/file/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use reearth_flow_storage::resolve::StorageResolver;

use reearth_flow_common::uri::Uri;

use reearth_flow_types::{AttributeValue, Expr, Feature};
use reearth_flow_types::{AttributeValue, Feature};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ExcelWriterParam {
pub(super) sheet_name: Option<Expr>,
pub(super) sheet_name: Option<String>,
}

pub(super) fn write_excel(
Expand All @@ -30,8 +30,8 @@ pub(super) fn write_excel(

let sheet_name = params
.sheet_name
.as_ref()
.map_or("Sheet1".to_string(), Expr::to_string);
.clone()
.unwrap_or_else(|| "Sheet1".to_string());
worksheet
.set_name(sheet_name)
.map_err(crate::errors::SinkError::file_writer)?;
Expand Down
2 changes: 1 addition & 1 deletion engine/schema/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@
"sheetName": {
"anyOf": [
{
"$ref": "#/definitions/Expr"
"type": "string"
},
{
"type": "null"
Expand Down

0 comments on commit 917cd44

Please sign in to comment.