Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: object has no attribute 'set_event_manager' #4200

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/backend/base/langflow/graph/vertex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pandas as pd
from loguru import logger

from langflow.custom import Component
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an Error here from Mypy/ lint since Component was used only for TypeChecking.
But works without error.
@cbornet do we have an exception added for this scenario?

from langflow.exceptions.component import ComponentBuildException
from langflow.graph.schema import INPUT_COMPONENTS, OUTPUT_COMPONENTS, InterfaceComponentTypes, ResultData
from langflow.graph.utils import UnbuiltObject, UnbuiltResult, log_transaction
Expand All @@ -30,7 +31,6 @@
if TYPE_CHECKING:
from uuid import UUID

from langflow.custom import Component
from langflow.events.event_manager import EventManager
from langflow.graph.edge.base import CycleEdge, Edge
from langflow.graph.graph.base import Graph
Expand Down Expand Up @@ -495,7 +495,8 @@ async def _build(
)
else:
custom_component = self._custom_component
self._custom_component.set_event_manager(event_manager)
if isinstance(self._custom_component, Component):
custom_component.set_event_manager(event_manager)
custom_params = initialize.loading.get_params(self.params)

await self._build_results(
Expand Down
Loading