You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced strange behaviors while trying to make LCA computations.
First time the project is created and setup, everything works fine but next calls result in failures of the kind:
def execute_sql(self, sql, params=None, commit=None): if commit is not None: __deprecated__('"commit" has been deprecated and is a no-op.') logger.debug((sql, params)) with __exception_wrapper__: cursor = self.cursor()
> cursor.execute(sql, params or ())E peewee.OperationalError: no such table: bw2schema../../../../.local/share/mise/installs/python/3.12.5/lib/python3.12/site-packages/peewee.py:3322: OperationalError
After some investigation, it results the issue comes from the fact I am reusing a database.
I've created a failing unit test in bw2data to illustrate that, which I would expect to pass:
when deleting the database, the search pickle is not removed
and when recreated, the tables are created only the pickle file does not exists
I am not sure how to fix properly, however I propose at least a workaround for those who encounter the same issue:
Call make_searchable when trying to reuse a db (this forces the creation of tables).
Edit:
Another workaround if you don't need the db to be searchable, register the db with searchable=False
database.register(searchable=False)
This should be faster.
The text was updated successfully, but these errors were encountered:
I experienced strange behaviors while trying to make LCA computations.
First time the project is created and setup, everything works fine but next calls result in failures of the kind:
After some investigation, it results the issue comes from the fact I am reusing a database.
I've created a failing unit test in bw2data to illustrate that, which I would expect to pass:
It fails because:
I am not sure how to fix properly, however I propose at least a workaround for those who encounter the same issue:
Call
make_searchable
when trying to reuse a db (this forces the creation of tables).Edit:
Another workaround if you don't need the db to be searchable, register the db with
searchable=False
This should be faster.
The text was updated successfully, but these errors were encountered: