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

SQL Query component doesn't work #4662

Closed
SavvySupport opened this issue Nov 18, 2024 · 2 comments · Fixed by #4668
Closed

SQL Query component doesn't work #4662

SavvySupport opened this issue Nov 18, 2024 · 2 comments · Fixed by #4668
Assignees
Labels
bug Something isn't working

Comments

@SavvySupport
Copy link

Bug Description

When I try to run a query, it gives me an error:
'SQLExecutorComponent' object has no attribute 'set_event_manager'

Reproduction

  1. Using the "SQL Query" component, enter in DB URL, and query.
  2. Run the component
  3. It provides the following error message:

'SQLExecutorComponent' object has no attribute 'set_event_manager'

Traceback (most recent call last):
File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/api/v1/chat.py", line 227, in _build_vertex
vertex_build_result = await graph.build_vertex(
File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/graph/graph/base.py", line 1419, in build_vertex
await vertex.build(
File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 818, in build
await step(user_id=user_id, event_manager=event_manager, **kwargs)
File "/langflow1.1.0/venv1.1.0/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 493, in _build
self.custom_component.set_event_manager(event_manager)
AttributeError: 'SQLExecutorComponent' object has no attribute 'set_event_manager'

Expected behavior

Expected to return the queried results.

Who can help?

No response

Operating System

MacOS

Langflow Version

1.1

Python Version

3.10

Screenshot

No response

Flow File

No response

@SavvySupport SavvySupport added the bug Something isn't working label Nov 18, 2024
Copy link

dosubot bot commented Nov 18, 2024

The error you're encountering is due to the SQLExecutorComponent not having a set_event_manager method. This method is typically used to associate an EventManager instance with a component, allowing it to handle events like messages or logs [1].

To resolve this issue, you need to ensure that the SQLExecutorComponent class implements the set_event_manager method. This method should assign the provided EventManager instance to an attribute within the component, enabling it to utilize the event manager's functionality for event handling.

Here's a basic example of how you might implement this method in the SQLExecutorComponent class:

class SQLExecutorComponent(CustomComponent):
    # existing attributes and methods

    def set_event_manager(self, event_manager):
        self.event_manager = event_manager

By adding this method, the SQLExecutorComponent will be able to handle events as expected, and the error should be resolved.

To continue talking to Dosu, mention @dosu.

@SavvySupport
Copy link
Author

Thanks @ogabrielluiz ! When will these fixes be pushed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants