refactor(api): migrate console/service_api.dataset.segment to BaseModel#36630
Closed
cqjjjzr wants to merge 1 commit into
Closed
refactor(api): migrate console/service_api.dataset.segment to BaseModel#36630cqjjjzr wants to merge 1 commit into
cqjjjzr wants to merge 1 commit into
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-05-25 14:34:58.679891594 +0000
+++ /tmp/pyrefly_pr.txt 2026-05-25 14:34:45.391876144 +0000
@@ -2102,24 +2102,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 Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:52:20
-ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:75:16
-ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:76:16
-ERROR Missing argument `content` in function `controllers.common.controller_schemas.ChildChunkCreatePayload.__init__` [missing-argument]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:120:36
-ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `limit` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:160:33
-ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:165:33
-ERROR Argument `list[DocumentSegment] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:295:20
-ERROR Missing argument `tenant_id` in function `services.dataset_service.SegmentService.get_segments` [missing-argument]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:304:54
-ERROR Argument `list[str] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:597:20
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]
|
Contributor
Pyrefly Type Coverage
|
Contributor
Author
|
duplicate of #36522, closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
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_segmentscontrollers.service_api.dataset.segmentMissing integration test is added
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods