Skip to content

BUG: run_callable is deprecated in sqlalchemy 1.4 #40467

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

Closed
jrbourbeau opened this issue Mar 16, 2021 · 3 comments
Closed

BUG: run_callable is deprecated in sqlalchemy 1.4 #40467

jrbourbeau opened this issue Mar 16, 2021 · 3 comments
Labels
Dependencies Required and optional dependencies

Comments

@jrbourbeau
Copy link
Contributor

Code Sample, a copy-pastable example

I've not yet been able to isolate the code path where run_callable is used

pandas/pandas/io/sql.py

Lines 1615 to 1618 in ac3e3f7

def has_table(self, name: str, schema: Optional[str] = None):
return self.connectable.run_callable(
self.connectable.dialect.has_table, name, schema or self.meta.schema
)

However, it looks like several tests, for example pandas/tests/io/test_sql.py::TestSQLApi.test_timedelta, will trigger this warning. For instance here's a recent CI build where a deprecation warning is being raised and actually causes the test to fail.

Problem description

run_callable is deprecated in sqlalchemy 1.4 -- Connection.run_callable() should be used instead

Expected Output

Output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit           : f2c8480af2f25efdbd803218b9d87980f416563e
python           : 3.8.8.final.0
python-bits      : 64
OS               : Darwin
OS-release       : 20.3.0
Version          : Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64
machine          : x86_64
processor        : i386
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 1.2.3
numpy            : 1.20.1
pytz             : 2021.1
dateutil         : 2.8.1
pip              : 21.0.1
setuptools       : 49.6.0.post20210108
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : None
IPython          : 7.21.0
pandas_datareader: None
bs4              : None
bottleneck       : None
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : None
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pyxlsb           : None
s3fs             : None
scipy            : None
sqlalchemy       : 1.4.0
tables           : None
tabulate         : None
xarray           : None
xlrd             : None
xlwt             : None
numba            : None
@jrbourbeau jrbourbeau added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 16, 2021
@fangchenli
Copy link
Member

xref #40460

@fangchenli fangchenli added Dependencies Required and optional dependencies and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 16, 2021
@jorisvandenbossche
Copy link
Member

This might already be fixed (mostly/fully?) by #40471 ?

@jrbourbeau
Copy link
Contributor Author

Yep, I just tried out the latest pandas nightly release and don't see any sqlalchemy deprecations. Thanks for the heads up @jorisvandenbossche!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies
Projects
None yet
Development

No branches or pull requests

3 participants