From 8bdde3bc05426c7407792a06c073ce1a269593b9 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 18 Aug 2023 08:57:53 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(custom=5Fcomponent.py):?= =?UTF-8?q?=20remove=20unused=20import=20and=20update=20function=20name=20?= =?UTF-8?q?for=20better=20code=20organization=20and=20clarity=20?= =?UTF-8?q?=F0=9F=93=9D=20docs(custom=5Fcomponent.py):=20update=20docstrin?= =?UTF-8?q?g=20for=20better=20readability=20and=20understanding=20?= =?UTF-8?q?=F0=9F=94=A7=20chore(custom=5Fcomponent.py):=20add=20new=20file?= =?UTF-8?q?=20names.txt=20for=20locust=20tests=20with=20a=20list=20of=20na?= =?UTF-8?q?mes=20for=20load=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/custom_component.py | 4 ++-- tests/locust/names.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tests/locust/names.txt diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index b1b1a2080..d470b080b 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -169,7 +169,7 @@ class CustomComponent(Component, extra=Extra.allow): return validate.create_function(self.code, self.function_entrypoint_name) def load_flow(self, flow_id: str, tweaks: Optional[dict] = None) -> Any: - from langflow.processing.process import build_sorted_vertices_with_caching + from langflow.processing.process import build_sorted_vertices from langflow.processing.process import process_tweaks db_manager = get_db_manager() @@ -179,7 +179,7 @@ class CustomComponent(Component, extra=Extra.allow): raise ValueError(f"Flow {flow_id} not found") if tweaks: graph_data = process_tweaks(graph_data=graph_data, tweaks=tweaks) - return build_sorted_vertices_with_caching(graph_data) + return build_sorted_vertices(graph_data) def list_flows(self, *, get_session: Optional[Callable] = None) -> List[Flow]: get_session = get_session or session_getter diff --git a/tests/locust/names.txt b/tests/locust/names.txt new file mode 100644 index 000000000..555af7369 --- /dev/null +++ b/tests/locust/names.txt @@ -0,0 +1,5 @@ +Bob +Alice +John +Gabriel +Lily