From a9f955d916f6e25083b81cf97a661a45478c0a20 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 4 Jul 2024 09:18:37 -0300 Subject: [PATCH] fix: handle unknown artifact type in post_process_raw function (#2527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle the case where the artifact type is unknown and the raw value is not None in the post_process_raw function. Set the raw value to "Built Successfully ✨" in this case. --- src/backend/base/langflow/schema/artifact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/schema/artifact.py b/src/backend/base/langflow/schema/artifact.py index 97d449f7b..dce70f790 100644 --- a/src/backend/base/langflow/schema/artifact.py +++ b/src/backend/base/langflow/schema/artifact.py @@ -49,7 +49,7 @@ def get_artifact_type(value, build_result=None) -> str: def post_process_raw(raw, artifact_type: str): if artifact_type == ArtifactType.STREAM.value: raw = "" - elif artifact_type == ArtifactType.UNKNOWN.value: + elif artifact_type == ArtifactType.UNKNOWN.value and raw is not None: raw = "Built Successfully ✨" return raw