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

Backport #128 to fix #127 on bw2legacy #130

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

ccomb
Copy link
Contributor

@ccomb ccomb commented Mar 23, 2023

Hi, I got the same issue as in #127 but in the bw2legacy branch. So this is a backport of #128 onto bw2legacy.

Traceback (most recent call last):
(...)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/backends/peewee/database.py", line 260, in write
    self._efficient_write_many_data(data)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/backends/peewee/database.py", line 193, in _efficient_write_many_data
    self.delete(keep_params=True, warn=False)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/project.py", line 358, in writable_project
    return wrapped(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/backends/peewee/database.py", line 349, in delete
    sqlite3_lci_db.vacuum()
  File "/opt/conda/lib/python3.9/site-packages/bw2data/sqlite.py", line 57, in vacuum
    self.execute_sql('VACUUM;')
  File "/opt/conda/lib/python3.9/site-packages/bw2data/sqlite.py", line 50, in execute_sql
    return self.db.execute_sql(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/peewee.py", line 3236, in execute_sql
    cursor.execute(sql, params or ())
  File "/opt/conda/lib/python3.9/site-packages/peewee.py", line 3010, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/opt/conda/lib/python3.9/site-packages/peewee.py", line 192, in reraise
    raise value.with_traceback(tb)
  File "/opt/conda/lib/python3.9/site-packages/peewee.py", line 3236, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: cannot VACUUM from within a transaction

@cmutel cmutel merged commit 4609290 into brightway-lca:bw2legacy Apr 8, 2023
@ccomb ccomb deleted the vacuum branch July 4, 2023 01:38
@ccomb ccomb restored the vacuum branch July 4, 2023 01:38
@ccomb ccomb deleted the vacuum branch August 23, 2023 06:14
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

Successfully merging this pull request may close these issues.

2 participants