refactor(api): remove duplicated RAG entities from services layer#34689
Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom Apr 7, 2026
Merged
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-07 16:10:52.691370000 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-07 16:10:44.085373548 +0000
@@ -1,5 +1,5 @@
ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
- --> controllers/console/app/app.py:562:13
+ --> controllers/console/app/app.py:560:13
ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
--> controllers/console/auth/email_register.py:78:108
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
@@ -4953,39 +4953,39 @@
ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
--> tests/unit_tests/core/rag/rerank/test_reranker.py:1630:16
ERROR Argument `list[float] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1951:20
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1949:20
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2771:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2769:29
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2772:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2770:29
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3784:64
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3782:64
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3788:67
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3786:67
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4027:16
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4025:16
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4561:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4559:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4613:40
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4618:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4611:40
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4616:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4634:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4632:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4664:36
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4669:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4662:36
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4667:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4677:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4675:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4713:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4711:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4741:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4739:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4799:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4797:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4843:44
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4841:44
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.router.multi_dataset_react_route.ReactMultiDatasetRouter._handle_invoke_result` [bad-argument-type]
--> tests/unit_tests/core/rag/retrieval/test_multi_dataset_react_route.py:199:52
ERROR Argument `None` is not assignable to parameter `text` with type `str` in function `core.rag.splitter.text_splitter.RecursiveCharacterTextSplitter.split_text` [bad-argument-type]
@@ -6264,7 +6264,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 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
+ --> tests/unit_tests/services/dataset_service_test_helpers.py:447:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
--> tests/unit_tests/services/document_indexing_task_proxy.py:831:114
ERROR Argument `None` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
@@ -6281,7 +6281,7 @@
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:60:25
ERROR Argument `None` is not assignable to parameter `response` with type `Response` in function `httpx._exceptions.HTTPStatusError.__init__` [bad-argument-type]
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:61:26
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
--> tests/unit_tests/services/external_dataset_service.py:851:36
ERROR Cannot index into `list[Unknown]` [bad-index]
--> tests/unit_tests/services/hit_service.py:430:20
|
…ies/ fix fix refactor(api): extract shared RAG domain entities into core/rag/entities/ fix fix fix
2332f41 to
fbfa410
Compare
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-07 16:30:43.169326782 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-07 16:30:34.673523741 +0000
@@ -1,5 +1,5 @@
ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
- --> controllers/console/app/app.py:562:13
+ --> controllers/console/app/app.py:560:13
ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
--> controllers/console/auth/email_register.py:78:108
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
@@ -4953,39 +4953,39 @@
ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
--> tests/unit_tests/core/rag/rerank/test_reranker.py:1630:16
ERROR Argument `list[float] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1951:20
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1949:20
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2771:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2769:29
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2772:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2770:29
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3784:64
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3782:64
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3788:67
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3786:67
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4027:16
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4025:16
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4561:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4559:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4613:40
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4618:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4611:40
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4616:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4634:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4632:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4664:36
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4669:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4662:36
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4667:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4677:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4675:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4713:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4711:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4741:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4739:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4799:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4797:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4843:44
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4841:44
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.router.multi_dataset_react_route.ReactMultiDatasetRouter._handle_invoke_result` [bad-argument-type]
--> tests/unit_tests/core/rag/retrieval/test_multi_dataset_react_route.py:199:52
ERROR Argument `None` is not assignable to parameter `text` with type `str` in function `core.rag.splitter.text_splitter.RecursiveCharacterTextSplitter.split_text` [bad-argument-type]
@@ -6264,7 +6264,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 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
+ --> tests/unit_tests/services/dataset_service_test_helpers.py:447:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
--> tests/unit_tests/services/document_indexing_task_proxy.py:831:114
ERROR Argument `None` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
@@ -6281,7 +6281,7 @@
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:60:25
ERROR Argument `None` is not assignable to parameter `response` with type `Response` in function `httpx._exceptions.HTTPStatusError.__init__` [bad-argument-type]
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:61:26
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
--> tests/unit_tests/services/external_dataset_service.py:851:36
ERROR Cannot index into `list[Unknown]` [bad-index]
--> tests/unit_tests/services/hit_service.py:430:20
|
1 task
asukaminato0721
previously approved these changes
Apr 7, 2026
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-07 23:27:04.338256065 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-07 23:26:55.098251284 +0000
@@ -1,5 +1,5 @@
ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
- --> controllers/console/app/app.py:562:13
+ --> controllers/console/app/app.py:560:13
ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
--> controllers/console/auth/email_register.py:78:108
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
@@ -4953,39 +4953,39 @@
ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
--> tests/unit_tests/core/rag/rerank/test_reranker.py:1630:16
ERROR Argument `list[float] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1951:20
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1949:20
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2771:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2769:29
ERROR Could not find name `metadata_name` [unknown-name]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2772:29
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2770:29
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3784:64
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3782:64
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval._handle_invoke_result` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3788:67
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3786:67
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4027:16
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4025:16
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4561:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4559:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4613:40
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4618:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4611:40
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4616:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4634:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4632:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4664:36
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4669:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4662:36
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4667:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.single_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4677:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4675:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4713:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4711:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4741:36
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4739:36
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4799:40
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4797:40
ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `available_datasets` with type `list[Dataset]` in function `core.rag.retrieval.dataset_retrieval.DatasetRetrieval.multiple_retrieve` [bad-argument-type]
- --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4843:44
+ --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4841:44
ERROR Argument `Iterator[Any | Unknown] | Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[Unknown]` in function `core.rag.retrieval.router.multi_dataset_react_route.ReactMultiDatasetRouter._handle_invoke_result` [bad-argument-type]
--> tests/unit_tests/core/rag/retrieval/test_multi_dataset_react_route.py:199:52
ERROR Argument `None` is not assignable to parameter `text` with type `str` in function `core.rag.splitter.text_splitter.RecursiveCharacterTextSplitter.split_text` [bad-argument-type]
@@ -6264,7 +6264,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 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
+ --> tests/unit_tests/services/dataset_service_test_helpers.py:447:28
ERROR Argument `Literal['']` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
--> tests/unit_tests/services/document_indexing_task_proxy.py:831:114
ERROR Argument `None` is not assignable to parameter `plan` with type `CloudPlan` in function `DocumentIndexingTaskProxyTestDataFactory.create_mock_features` [bad-argument-type]
@@ -6281,7 +6281,7 @@
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:60:25
ERROR Argument `None` is not assignable to parameter `response` with type `Response` in function `httpx._exceptions.HTTPStatusError.__init__` [bad-argument-type]
--> tests/unit_tests/services/enterprise/test_plugin_manager_service.py:61:26
-ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+ERROR Argument `SimpleNamespace` is not assignable to parameter `metadata_condition` with type `MetadataFilteringCondition | None` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
--> tests/unit_tests/services/external_dataset_service.py:851:36
ERROR Cannot index into `list[Unknown]` [bad-index]
--> tests/unit_tests/services/hit_service.py:430:20
|
asukaminato0721
approved these changes
Apr 7, 2026
HanqingZ
pushed a commit
to HanqingZ/dify
that referenced
this pull request
Apr 23, 2026
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.
Part of issue #32385.
Note: This PR can only be merged after following PRs: #34685
#34692
I will ask one question for all Pydantic models: what concept does the model describe(Not who imports it)?
Based on answer, I will put models in proper place.
Summary
ParentMode,PreProcessingRule,Rule,Segmentationfromknowledge_entities.pyVectorSetting,KeywordSettingfromrag_pipeline_entities.pycore.rag.entities(canonical source from refactor(api): extract shared RAG domain entities into core/rag/entity #34685)Why this change
These models were defined in the
services/layer but consumed bycore/andmodels/— an upward dependency violation. #34685 extracted them intocore/rag/entities/. This PR removes the now-redundant copies fromservices/and updates all remaining consumers.Changes
services/entities/knowledge_entities/knowledge_entities.py: RemoveParentMode,PreProcessingRule,Segmentation,Ruledefinitions, importRulefrom canonical sourceservices/entities/knowledge_entities/rag_pipeline_entities.py: RemoveVectorSetting,KeywordSettingdefinitions, import from canonical sourcemodels/dataset.py: ImportParentMode,Rulefromcore.rag.entitiescore/rag/index_processor/processor/*.py: ImportRule,ParentModefromcore.rag.entitiesservices/vector_service.py: ImportParentModefromcore.rag.entitiesservices/hit_testing_service.py: ImportMetadataFilteringConditionfromcore.rag.entitiescontrollers/console/app/app.py: ImportPreProcessingRule,Rule,Segmentationfromcore.rag.entitiescontrollers/service_api/dataset/document.py: ImportPreProcessingRule,Rule,Segmentationfromcore.rag.entitiestests/.../dataset_service_test_helpers.py: Update importstests/.../document_service_validation.py: Update importstests/.../test_parent_child_index_processor.py: Update importsTest plan
ruff checkpasses