pypika icon indicating copy to clipboard operation
pypika copied to clipboard

quote_char = False doesn't work on Cast columns

Open RohitJacob opened this issue 1 year ago • 0 comments

table_name = 'test'
something = [Cast("a",'VARCHAR'),'b','c']

x = Query\
._builder(as_keyword=True)\
    .from_(table_name)\
    .select(*something)\
    .distinct()

x.get_sql(quote_char=False)

The quote_char=False doesn't remove the quotes from Cast column name. Actual Result: "SELECT DISTINCT CAST('a' AS VARCHAR),b,c FROM test"

Expected Result: "SELECT DISTINCT CAST(a AS VARCHAR),b,c FROM test"

Is there another way to get rid of the quotes within the cast function?

RohitJacob avatar Jul 11 '22 23:07 RohitJacob