Fixed PEP8 issues discovered after pycodestyle gets upgraded.

This commit is contained in:
Akshay Joshi
2020-05-13 17:14:32 +05:30
parent a9a1a975a6
commit 0620fafb6c
2 changed files with 4 additions and 4 deletions

View File

@@ -472,7 +472,7 @@ class SQLAutoComplete(object):
# We also use the unescape_name to make sure quoted names have
# the same priority as unquoted names.
lexical_priority = (
tuple(0 if c in(' _') else -ord(c)
tuple(0 if c in (' _') else -ord(c)
for c in self.unescape_name(item.lower())) + (1,) +
tuple(c for c in item)
)
@@ -659,7 +659,7 @@ class SQLAutoComplete(object):
if not suggestion.schema and \
(qualified[normalize_ref(rtbl.ref)] and
left.schema == right.schema or
left.schema not in(right.schema, 'public')):
left.schema not in (right.schema, 'public')):
join = left.schema + '.' + join
prio = ref_prio[normalize_ref(rtbl.ref)] * 2 + (
0 if (left.schema, left.tbl) in other_tbls else 1)

View File

@@ -379,7 +379,7 @@ def suggest_based_on_last_token(token, stmt):
# `SELECT 1 FROM functions WHERE function:`
try:
prev = stmt.get_previous_token(token).value.lower()
if prev in('drop', 'alter', 'create', 'create or replace'):
if prev in ('drop', 'alter', 'create', 'create or replace'):
return (Function(schema=schema, usage='signature'),)
except ValueError:
pass
@@ -511,5 +511,5 @@ def _allow_join(statement):
last_tok = statement.token_prev(len(statement.tokens))[1]
return (
last_tok.value.lower().endswith('join') and
last_tok.value.lower() not in('cross join', 'natural join')
last_tok.value.lower() not in ('cross join', 'natural join')
)