-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
read.sql fails with adodbapi connection #27547
Comments
Pandas only supports sqlite3 for in its DBAPI2 mode. Does a sqlalchemy engine for adodbapi exist? |
It seems this is supported in sqlalchemy: https://docs.sqlalchemy.org/en/13/dialects/mssql.html#module-sqlalchemy.dialects.mssql.adodbapi In general this is true, but in practice, |
It seems the I think this is because the adodbapi |
Correct @jorisvandenbossche. AFAIK, |
Also, a surface-level read of Additionally, as mentioned above basic |
As mentioned above, it is the |
I updated pandas and now I get the same KeyError. |
As mentioned above, this is a bug in |
ok. return self._getValue(self.rows.columnNames[name.lower()]) to: try: return self._getValue(self.rows.columnNames[name.lower()]) except: return False This works for me. |
It seems the project is on sourceforge: https://sourceforge.net/projects/adodbapi/. The https://pypi.org/project/adodbapi/ (at the bottom) mentions that the pywin32 mailing list can be used for this project. |
Awesome @TomAubrunner! The fix worked with pandas Thanks @jorisvandenbossche for looking into this! I believe we can close this ticket on |
@ParfaitG,
I’m not used to place requests, so it would be great if you re-ask this ticket on the pywin32 repo.
|
OK, thanks for the follow-up, closing then on the pandas side. |
Thank you. Seen on pywin32 mailing list. I will look into the problem. The suggested fix looks appropriate. |
Code Sample
Problem description
Similar to this recent python-forum.io post,
pandas.read_sql
does not work with the older module, adodbapi, which adheres to Python's DB-API 2.0 (PEP-249) standard and allows interfacing with OLEDB providers, a recognized, industry API for data sources. Above makes a successful connection to an MS Access database in Windows environment. However, thepandas.read_sql
results in following error:Do note: a regular
cursor.execute
andcursor.fetchall
works successfully without issue usingadodbapi
with or without parameters:Expected Output
Desired result would be exact data frame construction from
read_sql
as rendered successfully withpyodbc
which makes an ODBC connection (another industry recognized API to data sources) to the same database:Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.24.1
pytest: None
pip: 19.1.1
setuptools: 40.6.2
Cython: None
numpy: 1.15.4
scipy: 1.2.1
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.2
openpyxl: 2.6.2
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: 4.3.3
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10.1
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
None
The text was updated successfully, but these errors were encountered: