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 for sqlalchemy 2 and text upgrades #3267

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pjaol
Copy link

@pjaol pjaol commented Dec 20, 2023

Description

Quick fix for task history logging and sqlalchemy 2.x

Motivation and Context

Using sqlalchemy 2.x breaks luigid if task history is enabled
e.g.

[task_history]
db_connection = sqlite:///./log/luigi-task-hist.sqlite

Results in luigid exiting

File ".../env/lib/python3.11/site-packages/luigi/db_task_history.py", line 271, in _upgrade_schema
    for i in conn.execute('PRAGMA table_info(task_parameters);').fetchall():
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1414, in execute
    raise exc.ObjectNotExecutableError(statement) from err
sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: 'PRAGMA table_info(task_parameters);'

This is because sqlalchemy requires a sqlalchemy.text object vs string in conn.execute

Have you tested this? If so, how?

Tested locally with sqlite3 and sqlalchemy 2.0.23 and luigi 3.4.0

@pjaol pjaol requested review from dlstadther and a team as code owners December 20, 2023 22:53
tox.ini Outdated Show resolved Hide resolved
@pjaol
Copy link
Author

pjaol commented Jan 15, 2024

Hey @dlstadther what can I do to help move this forward?
I'm not sure what to look at to increase the code cov test

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