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

Error on executing Popular Entities code cell in GETTING_STARTED notebook. #292

Open
mikenelson-io opened this issue Aug 7, 2024 · 2 comments

Comments

@mikenelson-io
Copy link

Core 2024.8.0
Supervisor 2024.08.0
Operating System 12.4
Validated pip3 installs for all prerequisites

Error on executing Popular Entities code cell in GETTING_STARTED notebook.

Error with query: SELECT * FROM events JOIN event_data ON events.data_id = event_data.data_id WHERE event_type = 'call_service' ORDER BY time_fired
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py:1414, in Connection.execute(self, statement, parameters, execution_options)
   1413 try:
-> 1414     meth = statement._execute_on_connection
   1415 except AttributeError as err:

AttributeError: 'str' object has no attribute '_execute_on_connection'

The above exception was the direct cause of the following exception:

ObjectNotExecutableError                  Traceback (most recent call last)
Cell In[8], line 13
      9 # We keep track of contexts that we processed so that we will only process
     10 # the first service call in a context, and not subsequent calls.
     11 context_processed = set()
---> 13 for event in db.perform_query("SELECT * FROM events JOIN event_data ON events.data_id = event_data.data_id WHERE event_type = 'call_service' ORDER BY time_fired"):
     14     entity_ids = None
     16     # Skip if we have already processed an event that was part of this context

File /usr/local/lib/python3.11/dist-packages/detective/core.py:75, in HassDatabase.perform_query(self, query, **params)
     73 try:
     74     with self.engine.connect() as conn:
---> 75         return conn.execute(query, params)
     76 except:
     77     print(f"Error with query: {query}")

File /usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py:1416, in Connection.execute(self, statement, parameters, execution_options)
   1414     meth = statement._execute_on_connection
   1415 except AttributeError as err:
-> 1416     raise exc.ObjectNotExecutableError(statement) from err
   1417 else:
   1418     return meth(
   1419         self,
   1420         distilled_parameters,
   1421         execution_options or NO_OPTIONS,
   1422     )

ObjectNotExecutableError: Not an executable object: "SELECT * FROM events JOIN event_data ON events.data_id = event_data.data_id WHERE event_type = 'call_service' ORDER BY time_fired"
@SnokxStefan
Copy link

DO NOT USE OR INSTALL THIS , DOES NOT WORK AT ALL,, NO DOCUMENTATION, EXAMPLES DO NOT WORK

@rct
Copy link

rct commented Oct 13, 2024

FYI this is related to this issue in the Hass-data-detective module: robmarkcole/HASS-data-detective#157

Since there appears to be some activity in that repo robmarkcole/HASS-data-detective the problem may be that Frenck's add-on https://github.com/hassio-addons/addon-jupyterlab needs updates versions of robmarkcole/HASS-data-detective, sqlalchemy, and perhaps other modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants