mirror of https://github.com/zulip/zulip.git
narrow: Migrate legacy SQLAlchemy select syntax.
Fixes “sqlalchemy.exc.RemovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0.” with warnings enabled. https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#change-5284 Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
8682ea1a64
commit
dd0d482d76
|
@ -354,7 +354,7 @@ class NarrowBuilder:
|
|||
# If the initial query doesn't use `zerver_usermessage`
|
||||
check_col = literal_column("zerver_message.id", Integer)
|
||||
exists_cond = (
|
||||
select([1])
|
||||
select(1)
|
||||
.select_from(table("zerver_reaction"))
|
||||
.where(check_col == literal_column("zerver_reaction.message_id", Integer))
|
||||
.exists()
|
||||
|
|
|
@ -23,7 +23,7 @@ def topic_column_sa() -> ColumnElement[Text]:
|
|||
|
||||
def get_followed_topic_condition_sa(user_id: int) -> ColumnElement[Boolean]:
|
||||
follow_topic_cond = (
|
||||
select([1])
|
||||
select(1)
|
||||
.select_from(table("zerver_usertopic"))
|
||||
.where(
|
||||
and_(
|
||||
|
|
Loading…
Reference in New Issue