🔧 refactor(custom_component.py): refactor get_flow method signature to use Optional type hint for flow_name and flow_id parameters for better clarity and maintainability
This commit is contained in:
parent
10ca88f709
commit
95bf9ba233
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue