Closed thiagotei closed 5 years ago
I believe the issue might be similar to this one: https://stackoverflow.com/questions/620610/sqlalchemy-obtain-primary-key-with-autoincrement-before-commit/620831
If you add a session.flush()
does it get an id?
I've added a self.session.flush()
at the beginning of the results_query
function and the execution finished normally. I'm not sure if I added it to the right place, but looks like you nailed the issue.
Great, feel free to submit a PR with the fix.
If you end up here searching for this error message, it's likely that you're querying a relationship for objects that have not yet been added to a session, so they have no primary key. This is newly an error in SQLAlchemy 1.3; previously it would just return no results. See https://github.com/abrt/faf/issues/764#issuecomment-561702212 for details.
When using the SQLAlchemy version 1.3.4 and Python 2.7 I've got the following error:
I printed the
config.id
insideopentuner/driverbase.py
and it wasNone
. I do not have any issues with Sqlalchemy version1.2.[0-19]
.--Thiago