From 95bf9ba2339f5475dca912100dc66d016d645f04 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 31 Jul 2023 15:02:13 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20refactor(custom=5Fcomponent.py):?= =?UTF-8?q?=20refactor=20get=5Fflow=20method=20signature=20to=20use=20Opti?= =?UTF-8?q?onal=20type=20hint=20for=20flow=5Fname=20and=20flow=5Fid=20para?= =?UTF-8?q?meters=20for=20better=20clarity=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/custom_component.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index e1dcd83ab..fc8efcc5d 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -158,7 +158,9 @@ class CustomComponent(Component, extra=Extra.allow): flows = session.query(Flow).all() return flows - def get_flow(self, *, flow_name: str = None, flow_id: str = None) -> Flow: + def get_flow( + self, *, flow_name: Optional[str] = None, flow_id: Optional[str] = None + ) -> Flow: with session_getter() as session: if flow_id: flow = session.query(Flow).get(flow_id)