Key error when using adodbapi, azure and pandas - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Key error when using adodbapi, azure and pandas (/thread-16138.html) |
Key error when using adodbapi, azure and pandas - mazamus - Feb-15-2019 Hi! I'm using Anaconda environment (Spyder) for my Python development and until recently have been using adodbapi to connect to an Azure SQL server (namely because that one does not need an ODBC driver installed). With the established connection, I have been able to read stuff directly to a Pandas dataframe with pd.read_sql(), awesome. I just updated everything in my Anaconda environment so I don't exactly know what caused the issue, but now using the exact same code as before leads to a key error (the last rows of the generated output below): The code is simply:import pandas as pd import adodbapi connection = adodbapi.connect("PROVIDER=SQLOLEDB; Data Source={0}; \ Database={1}; trusted_connection=no; \ Uid={2}; PWD={3};".format(server, database, username, password)) df = pd.read_sql(dataSQL, connection)with string values assigned to the variables, and a legit SQL query as string in dataSQL. I have little to no understanding what is happening under the hood in these libraries, so any help is appreciated. What could be causing that key error? I am yet to try this with another connection type (have to wait for the IT to install the ODBC driver), but this connection method is widely used in my various code snippets and I would like to get it working again. RE: Key error when using adodbapi, azure and pandas - pr0faka - May-09-2019 Did you find a solution? I have the same issue with adodbapi after updating pandas RE: Key error when using adodbapi, azure and pandas - TomKom - Sep-11-2019 Hi, I found a solution. It's described there: adodbapi-patch suggestion at github Since adodbapi doesn't change much, this simple "patch" will last long. |