modin: Incorrect syntax error on read_sql

I am getting the following error in case of msssql.

Connection query details:

params1 = urllib.parse.quote_plus("driver={ODBC Driver 17 for SQL Server};server=server;database=Kepler;Uid=uid;Pwd=password;Encrypt=yes;")
engine2 = 'mssql+pyodbc:///?odbc_connect={}'.format(params1)

Error:

sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ')'. (102) (SQLExecDirectW)")
[SQL: SELECT COUNT(*) FROM (select * from cashflow_data as foo)]

Minimal code is as follows:

import modin.experimental.pandas as pd
query = f'''select * from cashflow_data'''
file_data = pd.read_sql(sql = query, con=engine2,max_sessions = 10)
y = datetime.datetime.now() - x

Dataset example:

instu_id cashflow_amount currency_code cf_type data_date import_source entity maturity_date
6.03675E+11 7500 KWD P 30-Sep-19 MANUAL RFOL 1-May-20
6.03468E+11 635.143 KWD P 30-Sep-19 MANUAL RFOL 30-Sep-19
6.03474E+11 20000 KWD P 30-Sep-19 MANUAL RFOL 31-Oct-19
6.03E+11 5149 KWD P 30-Sep-19 MANUAL RFOL 18-Feb-20
6.03511E+11 16635 KWD P 30-Sep-19 MANUAL RFOL 30-Oct-19

@devin-petersohn : Any way to fix it

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25

Commits related to this issue

Most upvoted comments

Thanks @SudharsanRama, we are planning on getting this fix out for all databases in the next release.

As a temporary workaround, you can pass a SQLAlchemy connection to the pd.read_sql command. It will not run in parallel, but it should work.