mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed PEP8 issues discovered after pycodestyle gets upgraded.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user