From 3cd0161c9ae388ca04aaf0a63028c4b9d9e91f71 Mon Sep 17 00:00:00 2001 From: "YAMON.IO" Date: Sat, 27 Jul 2024 06:25:15 +0900 Subject: [PATCH] fix: update CreateData.py (#2975) * Update CreateData.py Update to generate data correctly * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../base/langflow/components/prototypes/CreateData.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/backend/base/langflow/components/prototypes/CreateData.py b/src/backend/base/langflow/components/prototypes/CreateData.py index 873b25995..c77df1b57 100644 --- a/src/backend/base/langflow/components/prototypes/CreateData.py +++ b/src/backend/base/langflow/components/prototypes/CreateData.py @@ -63,21 +63,16 @@ class CreateDataComponent(Component): build_config["number_of_fields"]["value"] = field_value_int return build_config - async def build_data( - self, - number_of_fields: int = 0, - text_key: str = "text", - **kwargs, - ) -> Data: + async def build_data(self) -> Data: data = {} - for value_dict in kwargs.values(): + for value_dict in self._attributes.values(): if isinstance(value_dict, dict): # Check if the value of the value_dict is a Data value_dict = { key: value.get_text() if isinstance(value, Data) else value for key, value in value_dict.items() } data.update(value_dict) - return_data = Data(data=data, text_key=text_key) + return_data = Data(data=data, text_key=self.text_key) self.status = return_data return return_data