♻️ (component.py): refactor import statement to improve readability and maintainability
♻️ (component.py): refactor method variable type annotation for better clarity and consistency
This commit is contained in:
parent
3422cbd8e1
commit
d4e5b45237
1 changed files with 2 additions and 14 deletions
|
|
@ -1,17 +1,5 @@
|
||||||
import inspect
|
import inspect
|
||||||
from typing import (
|
from typing import TYPE_CHECKING, Any, AsyncIterator, Callable, ClassVar, Generator, Iterator, List, Optional, Union
|
||||||
TYPE_CHECKING,
|
|
||||||
Any,
|
|
||||||
AsyncIterator,
|
|
||||||
Awaitable,
|
|
||||||
Callable,
|
|
||||||
ClassVar,
|
|
||||||
Generator,
|
|
||||||
Iterator,
|
|
||||||
List,
|
|
||||||
Optional,
|
|
||||||
Union,
|
|
||||||
)
|
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
@ -124,7 +112,7 @@ class Component(CustomComponent):
|
||||||
# Build the output if it's connected to some other vertex
|
# Build the output if it's connected to some other vertex
|
||||||
# or if it's not connected to any vertex
|
# or if it's not connected to any vertex
|
||||||
if not vertex.outgoing_edges or output.name in vertex.edges_source_names:
|
if not vertex.outgoing_edges or output.name in vertex.edges_source_names:
|
||||||
method: Callable | Awaitable = getattr(self, output.method)
|
method: Callable = getattr(self, output.method)
|
||||||
if output.cache and output.value != UNDEFINED:
|
if output.cache and output.value != UNDEFINED:
|
||||||
_results[output.name] = output.value
|
_results[output.name] = output.value
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue