🔧 refactor(documentloaders.py): use Optional type hint for name parameter in format_field method
The `name` parameter in the `format_field` method of the `DocumentLoaderFrontNode` class now uses the `Optional` type hint to indicate that it can be None. This improves the code's readability and makes it easier to understand the expected behavior of the method.
This commit is contained in:
parent
7da5197f35
commit
e3ee146b12
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from typing import Optional
|
||||
from langflow.template.field.base import TemplateField
|
||||
from langflow.template.frontend_node.base import FrontendNode
|
||||
|
||||
|
|
@ -106,7 +107,7 @@ class DocumentLoaderFrontNode(FrontendNode):
|
|||
)
|
||||
|
||||
@staticmethod
|
||||
def format_field(field: TemplateField, name: str | None = None) -> None:
|
||||
def format_field(field: TemplateField, name: Optional[str] = None) -> None:
|
||||
FrontendNode.format_field(field, name)
|
||||
if field.name == "metadata":
|
||||
field.show = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue