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
- Inital test of pandas 0.1.0rc0 * Resolves #979 * Change all the locations of the pandas version * Make import changes that changed in pandas (minor) — committed to devin-petersohn/modin by devin-petersohn 4 years ago
- FEAT-#979: Allow read_sql from SQL server. This first commit was originally from @eavidan. @mvashishtha amended the description so that the pull request passed commitlint. Original description: sql ... — committed to mvashishtha/modin by eavidan 4 years ago
- FEAT-#979: Allow read_sql from SQL server. Signed-off-by: mvashishtha <mahesh@ponder.io> — committed to mvashishtha/modin by deleted user 2 years ago
- FEAT-#979: Allow read_sql from SQL server. This first commit was originally from @eavidan. @mvashishtha amended the description so that the pull request passed commitlint. Original description: sql ... — committed to mvashishtha/modin by eavidan 4 years ago
- FEAT-#979: Allow read_sql from SQL server. Signed-off-by: mvashishtha <mahesh@ponder.io> — committed to mvashishtha/modin by deleted user 2 years ago
- FEAT-#979: Enable reading from SQL server. (#4279) Co-authored-by: eavidan <eran.avidan@intel.com> Co-authored-by: Devin Petersohn <devin-petersohn@users.noreply.github.com> Signed-off-by: mvashish... — committed to modin-project/modin by mvashishtha 2 years ago
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.