Skip to content

Commit

Permalink
reformat file document_db.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuan23 committed Dec 8, 2023
1 parent d05afe1 commit 6dc3e99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pilot/server/knowledge/document_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_knowledge_documents_count_bulk(self, space_names):
counts_query = (
session.query(
KnowledgeDocumentEntity.space,
func.count(KnowledgeDocumentEntity.id).label('document_count')
func.count(KnowledgeDocumentEntity.id).label("document_count"),
)
.filter(KnowledgeDocumentEntity.space.in_(space_names))
.group_by(KnowledgeDocumentEntity.space)
Expand Down
4 changes: 3 additions & 1 deletion pilot/server/knowledge/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def get_knowledge_space(self, request: KnowledgeSpaceRequest):
)
spaces = knowledge_space_dao.get_knowledge_space(query)
space_names = [space.name for space in spaces]
docs_count = knowledge_document_dao.get_knowledge_documents_count_bulk(space_names)
docs_count = knowledge_document_dao.get_knowledge_documents_count_bulk(
space_names
)
responses = []
for space in spaces:
res = SpaceQueryResponse()
Expand Down

0 comments on commit 6dc3e99

Please sign in to comment.