Skip to content

BUG: run_callable is deprecated in sqlalchemy 1.4  #40467

Closed
@jrbourbeau

Description

@jrbourbeau

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependenciesRequired and optional dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions