refactor: select in service API dataset document and segment controllers#34101
Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom Mar 26, 2026
Merged
Conversation
Contributor
Pyrefly DiffNo changes detected. |
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-25 21:35:11.623460185 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-25 21:35:00.156462605 +0000
@@ -6951,7 +6951,7 @@
ERROR Could not import `MetadataValue` from `services.entities.knowledge_entities.knowledge_entities` [missing-module-attribute]
--> tests/unit_tests/services/dataset_metadata.py:95:5
ERROR Cannot find module `dify_graph.model_runtime.entities.model_entities` [missing-import]
- --> tests/unit_tests/services/dataset_service_test_helpers.py:19:1
+ --> tests/unit_tests/services/dataset_service_test_helpers.py:13:1
ERROR Argument `str` is not assignable to parameter `indexing_technique` with type `Literal['economy', 'high_quality']` in function `services.entities.knowledge_entities.rag_pipeline_entities.KnowledgeConfiguration.__init__` [bad-argument-type]
--> tests/unit_tests/services/dataset_service_test_helpers.py:449:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
|
c085300 to
ed1029c
Compare
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-25 22:25:22.134986925 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-25 22:25:10.747901200 +0000
@@ -6950,8 +6950,6 @@
--> tests/unit_tests/services/auth/test_jina_auth.py:35:22
ERROR Could not import `MetadataValue` from `services.entities.knowledge_entities.knowledge_entities` [missing-module-attribute]
--> tests/unit_tests/services/dataset_metadata.py:95:5
-ERROR Cannot find module `dify_graph.model_runtime.entities.model_entities` [missing-import]
- --> tests/unit_tests/services/dataset_service_test_helpers.py:19:1
ERROR Argument `str` is not assignable to parameter `indexing_technique` with type `Literal['economy', 'high_quality']` in function `services.entities.knowledge_entities.rag_pipeline_entities.KnowledgeConfiguration.__init__` [bad-argument-type]
--> tests/unit_tests/services/dataset_service_test_helpers.py:449:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-25 22:27:28.082149320 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-25 22:27:16.577188069 +0000
@@ -6950,8 +6950,6 @@
--> tests/unit_tests/services/auth/test_jina_auth.py:35:22
ERROR Could not import `MetadataValue` from `services.entities.knowledge_entities.knowledge_entities` [missing-module-attribute]
--> tests/unit_tests/services/dataset_metadata.py:95:5
-ERROR Cannot find module `dify_graph.model_runtime.entities.model_entities` [missing-import]
- --> tests/unit_tests/services/dataset_service_test_helpers.py:19:1
ERROR Argument `str` is not assignable to parameter `indexing_technique` with type `Literal['economy', 'high_quality']` in function `services.entities.knowledge_entities.rag_pipeline_entities.KnowledgeConfiguration.__init__` [bad-argument-type]
--> tests/unit_tests/services/dataset_service_test_helpers.py:449:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
|
de5ecdf to
7abbcbc
Compare
Contributor
Pyrefly DiffNo changes detected. |
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-26 01:05:20.686806883 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-26 01:05:10.319861696 +0000
@@ -6951,7 +6951,7 @@
ERROR Could not import `MetadataValue` from `services.entities.knowledge_entities.knowledge_entities` [missing-module-attribute]
--> tests/unit_tests/services/dataset_metadata.py:95:5
ERROR Cannot find module `dify_graph.model_runtime.entities.model_entities` [missing-import]
- --> tests/unit_tests/services/dataset_service_test_helpers.py:19:1
+ --> tests/unit_tests/services/dataset_service_test_helpers.py:13:1
ERROR Argument `str` is not assignable to parameter `indexing_technique` with type `Literal['economy', 'high_quality']` in function `services.entities.knowledge_entities.rag_pipeline_entities.KnowledgeConfiguration.__init__` [bad-argument-type]
--> tests/unit_tests/services/dataset_service_test_helpers.py:449:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
|
Contributor
Author
|
@asukaminato0721 These failures are not from my code change. Please review. Thanks. |
asukaminato0721
approved these changes
Mar 26, 2026
Contributor
Author
|
thanks. |
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.
Summary
db.session.query()calls to SQLAlchemy 2.0select()style incontrollers/service_api/dataset/document.py(9) andsegment.py(9)session.scalar(select(...).where(...).limit(1))for filtered lookupssession.scalar(select(func.count(...)).where(...))for count querieslogic or assertions changed)
Test plan
Part of #22668