Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: replace .distinct() with .group_by(Conversation.id) for PostgreSQL JSON compatibility (#36610)

Cocoon-Breake617435d034c
diff --git a/api/controllers/console/app/conversation.py b/api/controllers/console/app/conversation.py
index 6216a7bcbe2..0ca7a082863 100644
--- a/api/controllers/console/app/conversation.py
+++ b/api/controllers/console/app/conversation.py
@@ -134,7 +134,7 @@ class CompletionConversationApi(Resource):
.join( # type: ignore
MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id
)
- .distinct()
+ .group_by(Conversation.id)
)
elif args.annotation_status == "not_annotated":
query = (
@@ -272,7 +272,7 @@ class ChatConversationApi(Resource):
.join( # type: ignore
MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id
)
- .distinct()
+ .group_by(Conversation.id)
)
case "not_annotated":
query = (