-
-
Notifications
You must be signed in to change notification settings - Fork 900
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
Possible issue on session get_bind #953
Comments
I have absolutely no idea what's going on there, it seems that the frame isn't even available to debug. If you have time, I'd appreciate if you could dig into it, because I won't have time soon. |
Sure @davidism I'll dig into it. At first it seemed like something was obviously wrong with what I was doing |
I looked at the code briefly and didn't see anything. Check the sqlalchemy version, might be a compatibility issue? |
Just a couple of notes: Using SQLAlchemy directly we don't have any issue: from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine("sqlite:///example.sqlite")
session = sessionmaker(bind=engine)()
session.get_bind() Using flask-sqlalchemy with SQLAlchemy < 1.4.0:
using SQLAlchemy > 1.4.0
https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/orm/session.py#L4026 |
hey this is probably buggy on my end FYI, not sure how to fix yet |
Adjusted the means by which classes such as :class:`_orm.scoped_session` and :class:`_asyncio.AsyncSession` are generated from the base :class:`_orm.Session` class, such that custom :class:`_orm.Session` subclasses such as that used by Flask-SQLAlchemy don't need to implement positional arguments when they call into the superclass method, and can continue using the same argument styles as in previous releases. Fixes: #6285 References: pallets-eco/flask-sqlalchemy#953 Change-Id: I8612ab33743625e70eb158efceb0636d783c92a5
Leaving an update here:
No problem on Flask-SQLAlchemy current master: branch 2.x
current master (bind on kwargs):
Any ETA for 3.0.0 ? |
hi, was just wondering what the next steps are for this? do we need something like 2.5.2 with #943 included in the release? edit: originally linked to wrong PR |
Hello, |
Please see this comment. |
I've been getting a related error with code such as entries = db.session.execute(s, bind=db.get_engine(bind="name")).all() which works with sqlalchemy 1.3.24 but fails with sqlalchemy 1.4.31 with
Unfortunately we rely heavily on pandas and pandas 1.4 raises an error unless sqlalchemy is >=1.4, so simply holding sqlalchemy back is more broadly problematic. However, while waiting for the update to engine = db.get_engine(bind="name")
session = db.create_scoped_session(options={'bind': engine})
entries = session.execute(s).all() |
fixed in #1087 |
This may be a problem on SQLAlchemy itself, simple example:
The output from the execution above:
Should return a SQLAlchemy engine
Environment:
The text was updated successfully, but these errors were encountered: