diff options
author | Federico Caselli <cfederico87@gmail.com> | 2020-09-02 23:46:06 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-08 17:13:48 -0400 |
commit | e8600608669d90c4a6385b312d271aed63eb5854 (patch) | |
tree | ef984a01c536b2c81d2283b3ca5d9f4395f41dd0 /test/ext/declarative/test_basic.py | |
parent | 0d56a62f721ee6c91d8a8b6a407b959c9215b3b6 (diff) | |
download | sqlalchemy-e8600608669d90c4a6385b312d271aed63eb5854.tar.gz |
Update select usage to use the new 1.4 format
This change includes mainly that the bracketed use within
select() is moved to positional, and keyword arguments are
removed from calls to the select() function. it does not
yet fully address other issues such as keyword arguments passed
to the table.select().
Additionally, allows False / None to both be considered
as "disable" for all of select.correlate(), select.correlate_except(),
query.correlate(), which establishes consistency with
passing of ``False`` for the legact select(correlate=False)
argument.
Change-Id: Ie6c6e6abfbd3d75d4c8de504c0cf0159e6999108
Diffstat (limited to 'test/ext/declarative/test_basic.py')
-rw-r--r-- | test/ext/declarative/test_basic.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ext/declarative/test_basic.py b/test/ext/declarative/test_basic.py index 7713f3d77..b7b5ec61a 100644 --- a/test/ext/declarative/test_basic.py +++ b/test/ext/declarative/test_basic.py @@ -1481,7 +1481,7 @@ class DeclarativeTest(DeclarativeTestBase): user_id = Column("user_id", Integer, ForeignKey("users.id")) User.address_count = sa.orm.column_property( - sa.select([sa.func.count(Address.id)]) + sa.select(sa.func.count(Address.id)) .where(Address.user_id == User.id) .scalar_subquery() ) @@ -1528,7 +1528,7 @@ class DeclarativeTest(DeclarativeTestBase): # this doesn't really gain us anything. but if # one is used, lets have it function as expected... return sa.orm.column_property( - sa.select([sa.func.count(Address.id)]) + sa.select(sa.func.count(Address.id)) .where(Address.user_id == cls.id) .scalar_subquery() ) @@ -1628,9 +1628,9 @@ class DeclarativeTest(DeclarativeTestBase): name = Column("name", String(50)) adr_count = sa.orm.column_property( - sa.select( - [sa.func.count(Address.id)], Address.user_id == id - ).scalar_subquery() + sa.select(sa.func.count(Address.id)) + .where(Address.user_id == id) + .scalar_subquery() ) addresses = relationship(Address) @@ -1932,7 +1932,7 @@ class DeclarativeTest(DeclarativeTestBase): ) User.address_count = sa.orm.column_property( - sa.select([sa.func.count(Address.id)]) + sa.select(sa.func.count(Address.id)) .where(Address.user_id == User.id) .scalar_subquery() ) |