summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2020-09-30 15:30:00 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2020-09-30 15:30:00 +0200
commitf578d03ef7a0d1b0f84c59c4699ee307e725fc9c (patch)
treef16fc65a026eb2940c442efd5d06d2ae9b6e37ff /sqlparse
parent10231d89d76cb467729fb7391c6a80938d6c5f76 (diff)
downloadsqlparse-f578d03ef7a0d1b0f84c59c4699ee307e725fc9c.tar.gz
Improve formatting of type casts in parentheses.
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/filters/reindent.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sqlparse/filters/reindent.py b/sqlparse/filters/reindent.py
index 2b0f106..2d68abb 100644
--- a/sqlparse/filters/reindent.py
+++ b/sqlparse/filters/reindent.py
@@ -112,6 +112,8 @@ class ReindentFilter:
ttypes = T.Keyword.DML, T.Keyword.DDL
_, is_dml_dll = tlist.token_next_by(t=ttypes)
fidx, first = tlist.token_next_by(m=sql.Parenthesis.M_OPEN)
+ if first is None:
+ return
with indent(self, 1 if is_dml_dll else 0):
tlist.tokens.insert(0, self.nl()) if is_dml_dll else None