Skip to content

refactor(api): migrate console/service_api.dataset.document to BaseModel#36506

Merged
asukaminato0721 merged 3 commits into
langgenius:mainfrom
cqjjjzr:refac-basemodel
May 30, 2026
Merged

refactor(api): migrate console/service_api.dataset.document to BaseModel#36506
asukaminato0721 merged 3 commits into
langgenius:mainfrom
cqjjjzr:refac-basemodel

Conversation

@cqjjjzr
Copy link
Copy Markdown
Contributor

@cqjjjzr cqjjjzr commented May 22, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

See #28015 . Replace all inline Flask-RESTX request/response payload and query param models to Pydantic BaseModel.

Affected:

  • controllers.console.datasets.datasets_document
  • controllers.service_api.dataset.document

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. refactor labels May 22, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-30 14:25:29.164154852 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-30 14:25:15.074105958 +0000
@@ -2346,10 +2346,6 @@
    --> tests/unit_tests/controllers/service_api/dataset/rag_pipeline/test_rag_pipeline_workflow.py:328:33
 ERROR Missing argument `response_mode` in function `services.rag_pipeline.entity.pipeline_service_api_entities.PipelineRunApiEntity.__init__` [missing-argument]
    --> tests/unit_tests/controllers/service_api/dataset/rag_pipeline/test_rag_pipeline_workflow.py:328:33
-ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:238:16
-ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:239:16
 ERROR Missing argument `app_model` in function `protected_view` [missing-argument]
    --> tests/unit_tests/controllers/service_api/test_wraps.py:160:36
 ERROR `object` is not assignable to attribute `request` with type `Request` [bad-assignment]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 45.78% 45.82% +0.05%
Strict coverage 45.30% 45.34% +0.04%
Typed symbols 24,667 24,705 +38
Untyped symbols 29,527 29,520 -7
Modules 2762 2762 0

@asukaminato0721 asukaminato0721 enabled auto-merge May 22, 2026 04:12
auto-merge was automatically disabled May 22, 2026 04:17

Head branch was pushed to by a user without write access

@cqjjjzr cqjjjzr force-pushed the refac-basemodel branch from 113058b to 28e4977 Compare May 22, 2026 04:17
@asukaminato0721 asukaminato0721 enabled auto-merge May 22, 2026 04:29
auto-merge was automatically disabled May 25, 2026 02:07

Head branch was pushed to by a user without write access

@cqjjjzr cqjjjzr force-pushed the refac-basemodel branch from 28e4977 to 1375a96 Compare May 25, 2026 02:07
@WH-2099 WH-2099 self-assigned this May 26, 2026
@asukaminato0721 asukaminato0721 enabled auto-merge May 27, 2026 10:17
@WH-2099 WH-2099 self-requested a review May 30, 2026 11:58
@WH-2099 WH-2099 force-pushed the refac-basemodel branch from dcf9d69 to fe3eeea Compare May 30, 2026 14:19
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 30, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 30, 2026
Merged via the queue into langgenius:main with commit 5999600 May 30, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants