dfsql icon indicating copy to clipboard operation
dfsql copied to clipboard

KeyError if 'ORDER BY' contains table name

Open StpMax opened this issue 3 years ago • 2 comments

This query produce KeyError('COLUMNS.ORDINAL_POSITION') :

dfsql.sql_query(
    "SELECT * FROM COLUMNS WHERE COLUMNS.TABLE_SCHEMA = 'MINDSDB' AND COLUMNS.TABLE_NAME = 'predictors' ORDER BY COLUMNS.ORDINAL_POSITION",
    ds_kwargs={'case_sensitive': False},
    reduce_output=False,
    **{table_name: dataframe}
)

Dataframe has column 'ORDINAL_POSITION'

StpMax avatar Oct 28 '21 13:10 StpMax

dfsql.sql_query( "SELECT * FROM COLUMNS WHERE COLUMNS.TABLE_SCHEMA = 'MINDSDB' AND COLUMNS.TABLE_NAME = 'predictors' ORDER BY COLUMNS.ORDINAL_POSITION", ds_kwargs={'case_sensitive': False}, reduce_output=False, **{table_name: dataframe} )

after and columns.column_name should be there instead of table name

CCCCCCCE avatar Aug 20 '22 02:08 CCCCCCCE

@StpMax can we archive this project? or close issue?

tomhuds avatar May 25 '23 11:05 tomhuds