Python sqlparse _ New line after ( in subquery

41 Views Asked by At

I am using " https://github.com/andialbrecht/sqlparse/discussions/761 " My invoke program is "

print(sqlparse.format(first, reindent=True, keyword_case='upper', ofrmt='python', wrap_after=8, indent_after_first=True))

How can I make the result

SELECT dt,
count(1)
FROM
(SELECT dt,
WEEK
FROM fin_dim.dim_m_y23_sixth_weekday_jwm_a)
GROUP BY 1;

to the below

SELECT dt,
count(1)
FROM
(
SELECT dt,
WEEK
FROM fin_dim.dim_m_y23_sixth_weekday_jwm_a
)
GROUP BY 1;
  1. ie. I want to change the format of subquery without changing "count(1)".

Your reply is appreciated.

How can I be an expert in Python sqlparse, any suggestions.

0

There are 0 best solutions below