summaryrefslogtreecommitdiff
path: root/sqlparse/engine
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2014-03-30 14:24:33 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2015-01-17 09:24:35 +0100
commite51fbdff1d111a39dd78bb5e6b1ab1d8f599e51b (patch)
tree64e6faec1213ed50e2c3b70dd15ade3eec4f1fe1 /sqlparse/engine
parentd3ed00f4ee3dcd7ae12b091e5590ab49f715d96e (diff)
downloadsqlparse-e51fbdff1d111a39dd78bb5e6b1ab1d8f599e51b.tar.gz
Add flake8 to tox configuration and code cleanup.
Diffstat (limited to 'sqlparse/engine')
-rw-r--r--sqlparse/engine/grouping.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index d6f1360..e3b41c9 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -114,7 +114,7 @@ def group_as(tlist):
def _right_valid(token):
# Currently limited to DML/DDL. Maybe additional more non SQL reserved
# keywords should appear here (see issue8).
- return not token.ttype in (T.DML, T.DDL)
+ return token.ttype not in (T.DML, T.DDL)
def _left_valid(token):
if token.ttype is T.Keyword and token.value in ('NULL',):
@@ -210,9 +210,10 @@ def group_identifier(tlist):
if identifier_tokens and identifier_tokens[-1].ttype is T.Whitespace:
identifier_tokens = identifier_tokens[:-1]
if not (len(identifier_tokens) == 1
- and (isinstance(identifier_tokens[0], (sql.Function, sql.Parenthesis))
- or identifier_tokens[0].ttype in (T.Literal.Number.Integer,
- T.Literal.Number.Float))):
+ and (isinstance(identifier_tokens[0], (sql.Function,
+ sql.Parenthesis))
+ or identifier_tokens[0].ttype in (
+ T.Literal.Number.Integer, T.Literal.Number.Float))):
group = tlist.group_tokens(sql.Identifier, identifier_tokens)
idx = tlist.token_index(group) + 1
else: