BUG: Pandas >= 2.2.0and SQLALCHEMY does not work together #57053
Labels
Compat
pandas objects compatability with Numpy or Python functions
Dependencies
Required and optional dependencies
Duplicate Report
Duplicate issue or pull request
IO SQL
to_sql, read_sql, read_sql_query
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
produces error:
2024-01-24T11:57:31 cursor = self.execute(sql, params)
2024-01-24T11:57:31 File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2673, in execute
2024-01-24T11:57:31 cur = self.con.cursor()
2024-01-24T11:57:31 AttributeError: 'Connection' object has no attribute 'cursor'
Expected Behavior
Using odbc connection or pandas 2.0 works.
Using the denodo connection directly works.
might be related to: #51015
Installed Versions
commit : fd3f571
python : 3.10.12.final.0
python-bits : 64
OS : Linux
OS-release : 4.14.330-250.540.amzn2.x86_64
Version : #1 SMP Tue Nov 21 09:57:48 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.0
numpy : 1.25.2
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 59.6.0
pip : 23.3.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.9.9
jinja2 : 3.1.3
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2023.9.1
gcsfs : None
matplotlib : 3.7.3
numba : 0.58.1
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 15.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2023.9.1
scipy : 1.11.4
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: