Skip to content

Commit

Permalink
Merge branch 'main' into refactor/optimize-db-use
Browse files Browse the repository at this point in the history
  • Loading branch information
laipz8200 committed Dec 25, 2024
2 parents 3d6e07b + d5f3321 commit 6fc8cf7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions api/controllers/console/datasets/datasets_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,8 @@ def get(self, dataset_id, batch):
dataset_id = str(dataset_id)
batch = str(batch)
documents = self.get_batch_documents(dataset_id, batch)
response = {"tokens": 0, "total_price": 0, "currency": "USD", "total_segments": 0, "preview": []}
if not documents:
return response, 200
return {"tokens": 0, "total_price": 0, "currency": "USD", "total_segments": 0, "preview": []}, 200
data_process_rule = documents[0].dataset_process_rule
data_process_rule_dict = data_process_rule.to_dict()
info_list = []
Expand Down
4 changes: 2 additions & 2 deletions api/models/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def get_sign_content(self):
return text


class ChildChunk(db.Model):
class ChildChunk(db.Model): # type: ignore[name-defined]
__tablename__ = "child_chunks"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="child_chunk_pkey"),
Expand Down Expand Up @@ -910,7 +910,7 @@ class ExternalKnowledgeBindings(db.Model): # type: ignore[name-defined]
updated_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())


class DatasetAutoDisableLog(db.Model):
class DatasetAutoDisableLog(db.Model): # type: ignore[name-defined]
__tablename__ = "dataset_auto_disable_logs"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="dataset_auto_disable_log_pkey"),
Expand Down
2 changes: 1 addition & 1 deletion api/schedule/mail_clean_document_notify_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time

import click
from celery import shared_task
from celery import shared_task # type: ignore
from flask import render_template

from extensions.ext_mail import mail
Expand Down
2 changes: 1 addition & 1 deletion api/tasks/batch_clean_document_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time

import click
from celery import shared_task
from celery import shared_task # type: ignore

from core.rag.index_processor.index_processor_factory import IndexProcessorFactory
from core.tools.utils.web_reader_tool import get_image_upload_file_ids
Expand Down
2 changes: 1 addition & 1 deletion api/tasks/disable_segments_from_index_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time

import click
from celery import shared_task
from celery import shared_task # type: ignore

from core.rag.index_processor.index_processor_factory import IndexProcessorFactory
from extensions.ext_database import db
Expand Down
2 changes: 1 addition & 1 deletion api/tasks/enable_segments_to_index_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time

import click
from celery import shared_task
from celery import shared_task # type: ignore

from core.rag.index_processor.constant.index_type import IndexType
from core.rag.index_processor.index_processor_factory import IndexProcessorFactory
Expand Down

0 comments on commit 6fc8cf7

Please sign in to comment.