sqltypes-text
Some checks failed
Deploy on push / deploy (push) Failing after 9s

This commit is contained in:
Untone 2024-08-07 14:29:31 +03:00
parent 19c9ef462e
commit 3fde67a87d

View File

@ -1,7 +1,7 @@
from typing import List from typing import List
from sqlalchemy.orm import aliased, selectinload, joinedload from sqlalchemy.orm import aliased, selectinload, joinedload
from sqlalchemy.sql import union from sqlalchemy.sql import union
from sqlalchemy.dialects.postgresql.types import CITEXT from sqlalchemy.dialects.postgresql.types import sqltypes
from sqlalchemy.sql.expression import ( from sqlalchemy.sql.expression import (
and_, and_,
asc, asc,
@ -61,7 +61,7 @@ def query_shouts():
Author.slug, Author.slug,
"pic", "pic",
Author.pic, Author.pic,
).cast(CITEXT) # Преобразуем JSON в текст ).cast(sqltypes.Text) # Преобразуем JSON в текст
) )
).label("authors"), ).label("authors"),
func.array_agg( func.array_agg(
@ -75,7 +75,7 @@ def query_shouts():
Topic.body, Topic.body,
"slug", "slug",
Topic.slug, Topic.slug,
).cast(CITEXT) # Преобразуем JSON в текст ).cast(sqltypes.Text) # Преобразуем JSON в текст
) )
).label("topics"), ).label("topics"),
) )