Fix pep8 compat
This commit is contained in:
@@ -8,7 +8,7 @@ from .asserts import ( # noqa
|
||||
)
|
||||
from .exceptions import ImproperlyConfigured # noqa
|
||||
from .expression_parser import ExpressionParser # noqa
|
||||
from .expressions import array_agg, Asterisk, row_to_json # noqa
|
||||
from .expressions import array_agg, Asterisk, row_to_json # noqa
|
||||
from .functions import ( # noqa
|
||||
analyze,
|
||||
create_database,
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import ARRAY, JSON
|
||||
from sqlalchemy.ext.compiler import compiles
|
||||
from sqlalchemy.sql.elements import ColumnClause
|
||||
from sqlalchemy.sql.expression import (
|
||||
_literal_as_text,
|
||||
ClauseElement,
|
||||
@@ -123,7 +122,7 @@ class array_agg(GenericFunction):
|
||||
|
||||
|
||||
@compiles(array_agg, 'postgresql')
|
||||
def compile_json_array_length(element, compiler, **kw):
|
||||
def compile_array_agg(element, compiler, **kw):
|
||||
return "%s(%s)" % (element.name, compiler.process(element.clauses))
|
||||
|
||||
|
||||
|
@@ -9,11 +9,11 @@ from operator import attrgetter
|
||||
|
||||
import six
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.engine.interfaces import Dialect
|
||||
from sqlalchemy.ext.hybrid import hybrid_property
|
||||
from sqlalchemy.orm import mapperlib
|
||||
from sqlalchemy.orm.attributes import InstrumentedAttribute
|
||||
from sqlalchemy.orm.exc import UnmappedInstanceError
|
||||
from sqlalchemy.engine.interfaces import Dialect
|
||||
from sqlalchemy.orm.properties import ColumnProperty
|
||||
from sqlalchemy.orm.query import _ColumnEntity
|
||||
from sqlalchemy.orm.session import object_session
|
||||
|
@@ -41,12 +41,9 @@ class TestHasIndex(object):
|
||||
assert not has_index(self.table.c.is_archived)
|
||||
|
||||
def test_table_without_primary_key(self):
|
||||
Base = declarative_base()
|
||||
|
||||
article = sa.Table(
|
||||
'article',
|
||||
sa.MetaData(),
|
||||
sa.Column('name', sa.String)
|
||||
)
|
||||
|
||||
assert not has_index(article.c.name)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
from sqlalchemy_utils.functions import quote
|
||||
from tests import TestCase
|
||||
|
||||
|
@@ -97,7 +97,7 @@ class TestAsterisk(object):
|
||||
|
||||
assert str(Asterisk(Article.__table__)) == 'article.*'
|
||||
|
||||
def test_with_table_object(self):
|
||||
def test_with_quoted_identifier(self):
|
||||
Base = sa.ext.declarative.declarative_base()
|
||||
|
||||
class User(Base):
|
||||
|
Reference in New Issue
Block a user