From e09d3fe0bf689ad967d88c6db36ef5972ce9855f Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 30 Jan 2025 08:40:00 -0300 Subject: [PATCH] revert: update components filter and build artifact logic (#6022) --- .github/changes-filter.yaml | 1 + .../base/langflow/custom/custom_component/component.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml index 831a028a9..5efcb44e0 100644 --- a/.github/changes-filter.yaml +++ b/.github/changes-filter.yaml @@ -45,6 +45,7 @@ components: - "src/frontend/tests/extended/integrations/**" - "src/frontend/tests/extended/features/**" - "src/frontend/tests/extended/regression/**" + - "src/backend/base/langflow/custom/**" workspace: - "src/backend/base/langflow/inputs/**" diff --git a/src/backend/base/langflow/custom/custom_component/component.py b/src/backend/base/langflow/custom/custom_component/component.py index cd950a85f..639dbc240 100644 --- a/src/backend/base/langflow/custom/custom_component/component.py +++ b/src/backend/base/langflow/custom/custom_component/component.py @@ -957,19 +957,19 @@ class Component(CustomComponent): custom_repr = str(custom_repr) raw = self._process_raw_result(result) - artifact_type = get_artifact_type(raw or self.status, result) + artifact_type = get_artifact_type(self.status or raw, result) raw, artifact_type = post_process_raw(raw, artifact_type) return {"repr": custom_repr, "raw": raw, "type": artifact_type} def _process_raw_result(self, result): - if hasattr(result, "data"): + if self.status: + raw = self.status + elif hasattr(result, "data"): raw = result.data elif hasattr(result, "model_dump"): raw = result.model_dump() elif isinstance(result, dict | Data | str): raw = result.data if isinstance(result, Data) else result - elif self.status: - raw = self.status else: raw = result return raw