-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix #35484 - re-allow sqlalchemy declarative system to use %
in read_sql.
#36275
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
Conversation
@TomAugspurger any idea who to ping about sqlalchemy review? |
I'm not sure. Perhaps contributors on the issue that caused the regression.
…On Wed, Sep 23, 2020 at 3:03 PM jbrockmendel ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> any idea who to ping
about sqlalchemy review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36275 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIV77NXROY6LJSU4PL3SHJICTANCNFSM4RF2DVNQ>
.
|
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@john-bodley can you take a look at this |
I guess this is a known issue with SQLAlchemy (using 1.2.8 per the Pandas specs) using the default connection for certain dialects, i.e., from sqlalchemy import create_engine
engine = create_engine('postgresql://postgres:@localhost:5433/postgres', echo=False)
engine.execute("SELECT 1 % 2") # TypeError: 'dict' object does not support indexing versus the raw-connection: from sqlalchemy import create_engine
engine = create_engine('postgresql://postgres:@localhost:5433/postgres', echo=False)
cursor = engine.raw_connection().cursor()
cursor.execute("SELECT 1 % 2")
cursor.fetchone() # (1,) Googling the issue it seems taking the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you write a whatsnew entry (1.2). i think this would make evaluating this easier.
def test_read_sql_no_parameter_with_percent(self): | ||
self._read_sql_iris_no_parameter_with_percent() | ||
|
||
@pytest.mark.xfail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an explict xfail / message or reason
can you also merge master |
@john-bodley @jreback thanks for your feedback. I'll have some time after next week--will add a whatsnew entry and bring things up to date. |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
%
.pd.read_sql("SELECT 1 %% 2", engine)
fails. See BUG: Regression in pd.read_sql_query between 1.0.5 and 1.1.0 #35871.pd.read_sql(sqlalchemy.sql.text("SELECT 1 % 2"), engine)
fails. See BUG: read_sql no longer works simply with SqlAlchemy selectables and a quick fix #35484.no_parameter
, and wrapping string queries insql.text()
when no parameters are passed.I was going nuts trying to keep track of all the cases, so tossed them into a table! I didn't have time to explicitly check v1.05, so would be helpful if someone could verify that column (or I may be able to loop back to it)!
%
%%
%
%%
%