Open
Description
Describe the bug
Excessive indentation occurs around ARRAY subqueries after ::timestamp WITH TIMEZONE AS
.
To Reproduce
Format this code (reduced example -- indentation compounds and gets worse)
SELECT * FROM "tiles",
ARRAY (
(
SELECT * FROM "tiles"
)
):: timestamp WITH TIME ZONE AS "destruction_timespan_end_of_the_end",
ARRAY (
SELECT *
FROM "tiles"
) AS "destruction_statement_language",
sqlparse.format(sql, reindent=True, keyword_case="upper")
Expected behavior
Should format without excessive indentation of ARRAY
:
SELECT *
FROM "tiles",
ARRAY (
(SELECT *
FROM "tiles")):: timestamp WITH TIME ZONE AS "destruction_timespan_end_of_the_end",
ARRAY
(SELECT *
FROM "tiles") AS "destruction_statement_language",
Versions (please complete the following information):
- Python: 3.12.0
- sqlparse: 0.5.1
Additional context
A longer example (that takes 13s to format) is available here, with more severe indentation problems.
Metadata
Metadata
Assignees
Labels
No labels