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