Skip to content

test: migrate dataset service dataset mock tests to testcontainers#35194

Merged
asukaminato0721 merged 4 commits intolanggenius:mainfrom
jamesrayammons:test/migrate-dataset-service-dataset-to-testcontainers
Apr 14, 2026
Merged

test: migrate dataset service dataset mock tests to testcontainers#35194
asukaminato0721 merged 4 commits intolanggenius:mainfrom
jamesrayammons:test/migrate-dataset-service-dataset-to-testcontainers

Conversation

@jamesrayammons
Copy link
Copy Markdown
Contributor

Summary

  • Add Testcontainers integration coverage for SQL-backed dataset permission, lifecycle, collection-binding, and partial-member behaviors
  • Remove overlapping mock-based unit coverage from api/tests/unit_tests/services/test_dataset_service_dataset.py
  • Rely on existing Testcontainers suites for retrieval and document indexing coverage already migrated elsewhere

Part of #32454

Test plan

  • Verify migrated SQL cases now use real Testcontainers database fixtures
  • Keep remaining non-SQL unit coverage in place
  • Confirm the migrated files parse cleanly after the split

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 14, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 17:57:06.021808334 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 17:56:55.351718816 +0000
@@ -1165,6 +1165,12 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:44:62
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:36:20
+ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:38:58
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:65:20
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:45:20
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:49:20
@@ -6114,43 +6120,35 @@
 ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
    --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:460:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:310:93
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:184:93
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:334:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:208:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:377:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:251:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:694:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:568:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:704:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:578:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:743:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:617:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:766:74
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:640:74
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:833:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:707:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:871:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:745:9
 ERROR Argument `None` is not assignable to parameter `embedding_model_provider` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:937:38
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:811:38
 ERROR Argument `None` is not assignable to parameter `embedding_model` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:938:29
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:812:29
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:996:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:870:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1031:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:905:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1439:67
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1216:67
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1442:81
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1455:67
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1468:71
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1527:9
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1549:9
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1219:81
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_document.py:340:34
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 18:26:10.924144614 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 18:25:59.637152560 +0000
@@ -714,8 +714,6 @@
    --> tests/test_containers_integration_tests/controllers/service_api/dataset/test_dataset.py:183:29
 ERROR Missing argument `tag_id` in function `controllers.service_api.dataset.dataset.TagDeletePayload.__init__` [missing-argument]
    --> tests/test_containers_integration_tests/controllers/service_api/dataset/test_dataset.py:195:29
-ERROR `in` is not supported between `Literal['webapp-logo']` and `None` [not-iterable]
-   --> tests/test_containers_integration_tests/controllers/web/test_site.py:133:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:74:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
@@ -1167,6 +1165,12 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:44:62
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:36:20
+ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:38:58
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:65:20
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:45:20
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:49:20
@@ -1272,7 +1276,7 @@
    --> tests/test_containers_integration_tests/services/test_model_provider_service.py:187:24
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_ops_service.py:59:13
-ERROR Argument `dict[str, Any] | dict[Unknown, Unknown] | object | None` is not assignable to parameter `tracing_config` with type `SQLCoreOperations[dict[str, Any] | None] | dict[str, Any] | None` in function `models.model.TraceAppConfig.__init__` [bad-argument-type]
+ERROR Argument `dict[Unknown, Unknown] | object | None` is not assignable to parameter `tracing_config` with type `SQLCoreOperations[dict[Unknown, Unknown] | None] | dict[Unknown, Unknown] | None` in function `models.model.TraceAppConfig.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_ops_service.py:84:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/test_containers_integration_tests/services/test_recommended_app_service.py:198:16
@@ -2077,37 +2081,37 @@
 ERROR Could not find name `Import` [unknown-name]
    --> tests/unit_tests/controllers/inner_api/app/test_dsl.py:119:71
 ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:169:44
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:168:44
 ERROR Missing argument `user_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:169:44
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:168:44
 ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:186:31
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:185:31
 ERROR Missing argument `user_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:186:31
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:185:31
 ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:201:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:200:35
 ERROR Missing argument `user_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:201:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:200:35
 ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:223:44
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:222:44
 ERROR Missing argument `user_model` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:223:44
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:222:44
 ERROR Argument `type[PluginTestPayload]` is not assignable to parameter `payload_type` with type `type[BaseModel]` in function `controllers.inner_api.plugin.wraps.plugin_data` [bad-argument-type]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:251:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:250:35
 ERROR Missing argument `payload` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:257:36
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:256:36
 ERROR Argument `type[PluginTestPayload]` is not assignable to parameter `payload_type` with type `type[BaseModel]` in function `controllers.inner_api.plugin.wraps.plugin_data` [bad-argument-type]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:266:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:265:35
 ERROR Missing argument `payload` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:273:31
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:272:31
 ERROR Argument `type[TestPluginData.test_should_raise_error_on_invalid_payload.InvalidPayload]` is not assignable to parameter `payload_type` with type `type[BaseModel]` in function `controllers.inner_api.plugin.wraps.plugin_data` [bad-argument-type]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:284:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:283:35
 ERROR Missing argument `payload` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:291:31
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:290:31
 ERROR Argument `type[PluginTestPayload]` is not assignable to parameter `payload_type` with type `type[BaseModel]` in function `controllers.inner_api.plugin.wraps.plugin_data` [bad-argument-type]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:297:35
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:296:35
 ERROR Missing argument `payload` in function `protected_view` [missing-argument]
-   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:303:36
+   --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:302:36
 ERROR Cannot index into `Iterable[bytes]` [bad-index]
    --> tests/unit_tests/controllers/service_api/app/test_audio.py:189:16
 ERROR Cannot index into `Response` [bad-index]
@@ -2250,6 +2254,8 @@
    --> tests/unit_tests/controllers/web/test_pydantic_models.py:308:38
 ERROR Missing argument `inputs` in function `controllers.common.controller_schemas.WorkflowRunPayload.__init__` [missing-argument]
    --> tests/unit_tests/controllers/web/test_pydantic_models.py:329:31
+ERROR `in` is not supported between `Literal['webapp-logo']` and `None` [not-iterable]
+   --> tests/unit_tests/controllers/web/test_site.py:126:16
 ERROR `None` is not subscriptable [unsupported-operation]
   --> tests/unit_tests/controllers/web/test_web_passport.py:36:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.web.workflow_events.WorkflowEventsApi.get` [bad-argument-type]
@@ -3948,13 +3954,13 @@
 ERROR Class `Extension` has no class attribute `_Extension__module_extensions` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extension.py:29:30
 ERROR Class member `ConcreteTool.query` overrides parent class `ExternalDataTool` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/external_data_tool/test_base.py:20:17
+  --> tests/unit_tests/core/external_data_tool/test_base.py:18:17
 ERROR Class member `ConcreteTool.query` overrides parent class `ExternalDataTool` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/external_data_tool/test_base.py:36:17
+  --> tests/unit_tests/core/external_data_tool/test_base.py:34:17
 ERROR Class member `ConcreteTool.query` overrides parent class `ExternalDataTool` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/external_data_tool/test_base.py:51:17
+  --> tests/unit_tests/core/external_data_tool/test_base.py:49:17
 ERROR Class member `ConcreteTool.query` overrides parent class `ExternalDataTool` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/external_data_tool/test_base.py:63:17
+  --> tests/unit_tests/core/external_data_tool/test_base.py:61:17
 ERROR Argument `None` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.remove_additional_properties` [bad-argument-type]
   --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:50:38
 ERROR Argument `list[@_]` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.remove_additional_properties` [bad-argument-type]
@@ -4494,85 +4500,85 @@
 ERROR Argument `dict[str, str]` is not assignable to parameter `reranking_model` with type `RerankingModelDict | None` in function `core.rag.data_post_processor.data_post_processor.DataPostProcessor._get_rerank_model_instance` [bad-argument-type]
    --> tests/unit_tests/core/rag/data_post_processor/test_data_post_processor.py:182:33
 ERROR Class member `_Field.__eq__` overrides parent class `object` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:25:9
+  --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:24:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:95:21
+  --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:94:21
 ERROR Argument `list[Document | SimpleNamespace]` is not assignable to parameter `texts` with type `list[Document]` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.create` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:105:9
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:104:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:112:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:111:5
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:113:17
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:112:17
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:117:19
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:116:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:124:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:123:21
 ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:139:12
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:138:12
 ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:140:18
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:139:18
 ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:141:19
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:140:19
 ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:144:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:143:5
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:148:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:147:21
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:160:16
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:159:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:164:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:163:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:175:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:174:21
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:182:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:181:5
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:183:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:182:5
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:187:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:186:21
 ERROR Object of class `FunctionType` has no attribute `assert_not_called` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:194:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:193:5
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:195:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:194:5
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:204:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:203:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:232:24
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:231:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:236:26
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:235:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:246:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:245:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:257:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:256:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:273:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:272:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:277:42
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:276:42
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:291:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:290:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:307:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:306:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:321:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:320:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:343:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:342:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:363:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:362:21
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:369:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:368:5
 ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:370:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:369:5
 ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:372:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:371:5
 ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:374:5
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:373:5
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.rag.datasource.keyword.jieba.jieba.Jieba.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:378:21
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:377:21
 ERROR `SimpleNamespace` is not assignable to TypedDict key `segment` with type `DocumentSegment` [bad-typed-dict-key]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:390:25
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:389:25
 ERROR `SimpleNamespace` is not assignable to TypedDict key `segment` with type `DocumentSegment` [bad-typed-dict-key]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:391:25
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:390:25
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:397:19
+   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba.py:396:19
 ERROR Object of class `ModuleType` has no attribute `analyse` [missing-attribute]
   --> tests/unit_tests/core/rag/datasource/keyword/jieba/test_jieba_keyword_table_handler.py:30:5
 ERROR Object of class `ModuleType` has no attribute `default_tfidf` [missing-attribute]
@@ -4672,7 +4678,7 @@
 ERROR `Literal['john@test.com']` is not assignable to attribute `text` with type `Ellipsis` [bad-assignment]
    --> tests/unit_tests/core/rag/extractor/test_word_extractor.py:695:14
 ERROR Argument `Literal['semantic_search']` is not assignable to parameter `retrieval_method` with type `RetrievalMethod` in function `core.rag.index_processor.processor.paragraph_index_processor.ParagraphIndexProcessor.retrieve` [bad-argument-type]
-   --> tests/unit_tests/core/rag/indexing/processor/test_paragraph_index_processor.py:246:39
+   --> tests/unit_tests/core/rag/indexing/processor/test_paragraph_index_processor.py:241:39
 ERROR Argument `Literal['semantic_search']` is not assignable to parameter `retrieval_method` with type `RetrievalMethod` in function `core.rag.index_processor.processor.parent_child_index_processor.ParentChildIndexProcessor.retrieve` [bad-argument-type]
    --> tests/unit_tests/core/rag/indexing/processor/test_parent_child_index_processor.py:305:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `rules` with type `Rule` in function `core.rag.index_processor.processor.parent_child_index_processor.ParentChildIndexProcessor._split_child_nodes` [bad-argument-type]
@@ -4680,9 +4686,9 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `rules` with type `Rule` in function `core.rag.index_processor.processor.parent_child_index_processor.ParentChildIndexProcessor._split_child_nodes` [bad-argument-type]
    --> tests/unit_tests/core/rag/indexing/processor/test_parent_child_index_processor.py:333:63
 ERROR Argument `Literal['semantic_search']` is not assignable to parameter `retrieval_method` with type `RetrievalMethod` in function `core.rag.index_processor.processor.qa_index_processor.QAIndexProcessor.retrieve` [bad-argument-type]
-   --> tests/unit_tests/core/rag/indexing/processor/test_qa_index_processor.py:268:39
+   --> tests/unit_tests/core/rag/indexing/processor/test_qa_index_processor.py:267:39
 ERROR Missing required key `enable` for TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
-   --> tests/unit_tests/core/rag/indexing/processor/test_qa_index_processor.py:334:78
+   --> tests/unit_tests/core/rag/indexing/processor/test_qa_index_processor.py:333:78
 ERROR Argument `None` is not assignable to parameter `state` with type `InstanceState[Any]` in function `sqlalchemy.orm.exc.ObjectDeletedError.__init__` [bad-argument-type]
    --> tests/unit_tests/core/rag/indexing/test_indexing_runner.py:924:84
 ERROR Argument `Literal['completed']` is not assignable to parameter `after_indexing_status` with type `IndexingStatus` in function `core.indexing_runner.IndexingRunner._update_document_index_status` [bad-argument-type]
@@ -4698,39 +4704,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:1949:20
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:1948:20
 ERROR Could not find name `metadata_name` [unknown-name]
-    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2769:29
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2768:29
 ERROR Could not find name `metadata_name` [unknown-name]
-    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2770:29
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:2769: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:3782:64
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3781: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:3786:67
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:3785:67
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4025:16
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4024: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:4547:40
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4546: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:4599:40
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4598: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:4604:40
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4603: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:4620:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4619: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:4650:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4649: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:4655:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4654: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:4663:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4662: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:4699:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4698: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:4727:36
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4726: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:4785:40
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4784: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:4829:44
+    --> tests/unit_tests/core/rag/retrieval/test_dataset_retrieval.py:4828: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]
@@ -5244,11 +5250,11 @@
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `providers` with type `list[ToolProviderApiEntity]` in function `core.tools.builtin_tool.providers._positions.BuiltinToolProviderSort.sort` [bad-argument-type]
    --> tests/unit_tests/core/tools/test_builtin_tools_extra.py:328:53
 ERROR `None` is not assignable to attribute `runtime` with type `ToolRuntime` [bad-assignment]
-  --> tests/unit_tests/core/tools/test_custom_tool.py:97:20
+  --> tests/unit_tests/core/tools/test_custom_tool.py:96:20
 ERROR `list[SimpleNamespace]` is not assignable to attribute `parameters` with type `list[ToolParameter] | None` [bad-assignment]
-   --> tests/unit_tests/core/tools/test_custom_tool.py:118:34
+   --> tests/unit_tests/core/tools/test_custom_tool.py:117:34
 ERROR `list[SimpleNamespace]` is not assignable to attribute `parameters` with type `list[ToolParameter] | None` [bad-assignment]
-   --> tests/unit_tests/core/tools/test_custom_tool.py:124:34
+   --> tests/unit_tests/core/tools/test_custom_tool.py:123:34
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `ApiToolProvider` in function `core.tools.custom_tool.provider.ApiToolProviderController.from_db` [bad-argument-type]
   --> tests/unit_tests/core/tools/test_custom_tool_provider.py:36:52
@@ -5305,11 +5311,11 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `controller` with type `ToolProviderController` in function `core.tools.utils.encryption.create_tool_provider_encrypter` [bad-argument-type]
    --> tests/unit_tests/core/tools/utils/test_encryption.py:203:75
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> tests/unit_tests/core/tools/utils/test_message_transformer.py:88:12
+  --> tests/unit_tests/core/tools/utils/test_message_transformer.py:86:12
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> tests/unit_tests/core/tools/utils/test_message_transformer.py:89:12
+  --> tests/unit_tests/core/tools/utils/test_message_transformer.py:87:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/tools/utils/test_message_transformer.py:109:12
+   --> tests/unit_tests/core/tools/utils/test_message_transformer.py:107:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `core.tools.utils.dataset_retriever.dataset_retriever_tool.DatasetRetrieverTool.from_dataset` [bad-argument-type]
    --> tests/unit_tests/core/tools/utils/test_misc_utils_extra.py:112:17
 ERROR Argument `_FakeFlaskApp` is not assignable to parameter `flask_app` with type `Flask` in function `core.tools.utils.dataset_retriever.dataset_multi_retriever_tool.DatasetMultiRetrieverTool._retriever` [bad-argument-type]
@@ -5317,15 +5323,15 @@
 ERROR Argument `_FakeFlaskApp` is not assignable to parameter `flask_app` with type `Flask` in function `core.tools.utils.dataset_retriever.dataset_multi_retriever_tool.DatasetMultiRetrieverTool._retriever` [bad-argument-type]
    --> tests/unit_tests/core/tools/utils/test_misc_utils_extra.py:376:27
 ERROR Argument `Literal['builtin']` is not assignable to parameter `tool_type` with type `ToolProviderType` in function `core.tools.utils.model_invocation_utils.ModelInvocationUtils.invoke` [bad-argument-type]
-   --> tests/unit_tests/core/tools/utils/test_model_invocation_utils.py:111:31
+   --> tests/unit_tests/core/tools/utils/test_model_invocation_utils.py:110:31
 ERROR Argument `Literal['builtin']` is not assignable to parameter `tool_type` with type `ToolProviderType` in function `core.tools.utils.model_invocation_utils.ModelInvocationUtils.invoke` [bad-argument-type]
-   --> tests/unit_tests/core/tools/utils/test_model_invocation_utils.py:161:35
+   --> tests/unit_tests/core/tools/utils/test_model_invocation_utils.py:160:35
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/tools/utils/test_parser.py:115:12
+   --> tests/unit_tests/core/tools/utils/test_parser.py:114:12
 ERROR Argument `list[ToolParameter] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/tools/utils/test_parser.py:175:16
+   --> tests/unit_tests/core/tools/utils/test_parser.py:174:16
 ERROR Type `None` is not iterable [not-iterable]
-   --> tests/unit_tests/core/tools/utils/test_parser.py:178:54
+   --> tests/unit_tests/core/tools/utils/test_parser.py:177:54
 ERROR Argument `Literal['not a dict']` is not assignable to parameter `d` with type `dict[str, Any]` in function `core.tools.utils.message_transformer.safe_json_dict` [bad-argument-type]
    --> tests/unit_tests/core/tools/utils/test_tool_engine_serialization.py:206:28
 ERROR Argument `list[int]` is not assignable to parameter `d` with type `dict[str, Any]` in function `core.tools.utils.message_transformer.safe_json_dict` [bad-argument-type]
@@ -5661,19 +5667,21 @@
 ERROR Missing argument `name` in function `core.workflow.nodes.trigger_webhook.entities.WebhookBodyParameter.__init__` [missing-argument]
   --> tests/unit_tests/core/workflow/nodes/webhook/test_entities.py:77:29
 ERROR Argument `dict[str, dict[str, Any] | str]` is not assignable to parameter `config` with type `NodeConfigDict` in function `graphon.nodes.base.node.Node.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:61:16
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:60:16
 ERROR Object of class `GraphRuntimeState` has no attribute `app_config` [missing-attribute]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:67:5
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:66:5
 ERROR Object of class `GraphRuntimeState` has no attribute `app_config` [missing-attribute]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:68:5
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:67:5
 ERROR Object of class `TriggerWebhookNode` has no attribute `node_id` [missing-attribute]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:72:5
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_file_conversion.py:71:5
 ERROR Argument `dict[str, dict[str, Any] | str]` is not assignable to parameter `config` with type `NodeConfigDict` in function `graphon.nodes.base.node.Node.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:52:16
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:51:16
 ERROR Object of class `GraphRuntimeState` has no attribute `app_config` [missing-attribute]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:58:5
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:57:5
 ERROR Object of class `TriggerWebhookNode` has no attribute `node_id` [missing-attribute]
-  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:61:5
+  --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:60:5
+ERROR Cannot index into `object` [bad-index]
+   --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:106:12
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:107:12
 ERROR Cannot index into `object` [bad-index]
@@ -5690,8 +5698,6 @@
    --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:113:12
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:114:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:115:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `variable_pool` with type `VariablePool | None` in function `core.workflow.human_input_compat.EmailDeliveryConfig.render_body_template` [bad-argument-type]
   --> tests/unit_tests/core/workflow/test_human_input_compat.py:29:23
 ERROR Object of class `_InteractiveSurfaceDeliveryConfig` has no attribute `recipients` [missing-attribute]
@@ -5889,7 +5895,7 @@
 ERROR Argument `_FakeRedis` is not assignable to parameter `redis_client` with type `_RateLimiterRedisClient` in function `libs.helper.RateLimiter.__init__` [bad-argument-type]
   --> tests/unit_tests/libs/test_rate_limiter.py:42:22
 ERROR Argument `dict[@_, @_]` is not assignable to parameter `headers` with type `Message` in function `python_http_client.exceptions.HTTPError.__init__` [bad-argument-type]
-  --> tests/unit_tests/libs/test_sendgrid_client.py:39:99
+  --> tests/unit_tests/libs/test_sendgrid_client.py:38:99
 ERROR Argument `None` is not assignable to parameter `duration_str` with type `str` in function `libs.time_parser.parse_time_duration` [bad-argument-type]
   --> tests/unit_tests/libs/test_time_parser.py:54:38
 ERROR Argument `MockRequest` is not assignable to parameter `request` with type `Request` in function `libs.token.extract_access_token` [bad-argument-type]
@@ -5992,6 +5998,8 @@
    --> 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]
    --> tests/unit_tests/services/document_indexing_task_proxy.py:855:114
+ERROR Argument `Literal['invalid_action']` is not assignable to parameter `action` with type `Literal['archive', 'disable', 'enable', 'un_archive']` in function `services.dataset_service.DocumentService.batch_update_document_status` [bad-argument-type]
+  --> tests/unit_tests/services/document_service_status.py:70:81
 ERROR Unexpected keyword argument `workspace_id` in function `services.enterprise.enterprise_service.DefaultWorkspaceJoinResult.__init__` [unexpected-keyword]
    --> tests/unit_tests/services/enterprise/test_enterprise_service.py:239:40
 ERROR Unexpected keyword argument `workspace_id` in function `services.enterprise.enterprise_service.DefaultWorkspaceJoinResult.__init__` [unexpected-keyword]
@@ -6080,9 +6088,9 @@
 ERROR TypedDict `AnnotationSettingDisabledDict` does not have key `embedding_model` [bad-typed-dict-key]
     --> tests/unit_tests/services/test_annotation_service.py:1251:27
 ERROR Argument `_FakeStreams` is not assignable to parameter `redis_client` with type `Redis[Unknown] | RedisCluster[Unknown]` in function `libs.broadcast_channel.redis.streams_channel.StreamsBroadcastChannel.__init__` [bad-argument-type]
-  --> tests/unit_tests/services/test_app_generate_service_streaming_integration.py:96:36
+  --> tests/unit_tests/services/test_app_generate_service_streaming_integration.py:95:36
 ERROR Argument `_FakeRedisClient` is not assignable to parameter `redis_client` with type `Redis[Unknown] | RedisCluster[Unknown]` in function `libs.broadcast_channel.redis.channel.BroadcastChannel.__init__` [bad-argument-type]
-   --> tests/unit_tests/services/test_app_generate_service_streaming_integration.py:116:34
+   --> tests/unit_tests/services/test_app_generate_service_streaming_integration.py:115:34
 ERROR Argument `TestAsyncWorkflowService.test_should_dispatch_to_matching_celery_task_when_triggering_workflow.DummyAccount` is not assignable to parameter `user` with type `Account | EndUser` in function `services.async_workflow_service.AsyncWorkflowService.trigger_workflow_async` [bad-argument-type]
    --> tests/unit_tests/services/test_async_workflow_service.py:152:88
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `services.async_workflow_service.AsyncWorkflowService.trigger_workflow_async` [bad-argument-type]
@@ -6096,7 +6104,7 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `services.async_workflow_service.AsyncWorkflowService.reinvoke_trigger` [bad-argument-type]
    --> tests/unit_tests/services/test_async_workflow_service.py:318:22
 ERROR Argument `None` is not assignable to parameter `file` with type `FileStorage` in function `services.audio_service.AudioService.transcript_asr` [bad-argument-type]
-   --> tests/unit_tests/services/test_audio_service.py:318:61
+   --> tests/unit_tests/services/test_audio_service.py:317:61
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
     --> tests/unit_tests/services/test_billing_service.py:1613:41
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
@@ -6112,43 +6120,35 @@
 ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
    --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:460:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:310:93
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:180:93
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:334:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:204:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:377:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:247:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:694:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:564:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:704:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:574:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:743:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:613:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:766:74
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:636:74
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:833:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:703:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:871:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:741:9
 ERROR Argument `None` is not assignable to parameter `embedding_model_provider` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:937:38
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:807:38
 ERROR Argument `None` is not assignable to parameter `embedding_model` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:938:29
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:808:29
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:996:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:866:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1031:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:901:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1439:67
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1212:67
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1442:81
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1455:67
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1468:71
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1527:9
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1549:9
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1215:81
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_document.py:340:34
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]

auto-merge was automatically disabled April 14, 2026 18:45

Head branch was pushed to by a user without write access

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 18:47:03.944157939 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 18:46:52.961127920 +0000
@@ -1155,6 +1155,12 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:44:62
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:37:20
+ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:39:58
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:66:20
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:45:20
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:49:20
@@ -6100,43 +6106,35 @@
 ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
    --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:460:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:310:93
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:180:93
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:334:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:204:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:377:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:247:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:694:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:564:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:704:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:574:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:743:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:613:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:766:74
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:636:74
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:833:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:703:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:871:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:741:9
 ERROR Argument `None` is not assignable to parameter `embedding_model_provider` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:937:38
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:807:38
 ERROR Argument `None` is not assignable to parameter `embedding_model` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:938:29
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:808:29
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:996:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:866:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1031:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:901:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1439:67
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1212:67
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1442:81
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1455:67
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1468:71
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1527:9
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1549:9
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1215:81
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_document.py:340:34
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 19:05:04.080907940 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 19:04:53.401746405 +0000
@@ -1155,6 +1155,12 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:44:62
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:37:20
+ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:39:58
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
+  --> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:66:20
+ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:45:20
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_dataset_service_retrieval.py:49:20
@@ -6100,43 +6106,35 @@
 ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
    --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:460:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:310:93
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:180:93
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:334:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:204:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.dataset_service.DatasetService.create_empty_dataset` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:377:25
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:247:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:694:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:564:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:704:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:574:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:743:70
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:613:70
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.DatasetService._update_pipeline_knowledge_base_node_data` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:766:74
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:636:74
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:833:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:703:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:871:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:741:9
 ERROR Argument `None` is not assignable to parameter `embedding_model_provider` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:937:38
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:807:38
 ERROR Argument `None` is not assignable to parameter `embedding_model` with type `str` in function `tests.unit_tests.services.dataset_service_test_helpers.DatasetServiceUnitDataFactory.create_dataset_mock` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:938:29
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:808:29
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/test_dataset_service_dataset.py:996:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:866:9
 ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1031:9
+   --> tests/unit_tests/services/test_dataset_service_dataset.py:901:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1439:67
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1212:67
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1442:81
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1455:67
-ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | None` in function `services.dataset_service.DatasetService.check_dataset_operator_permission` [bad-argument-type]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1468:71
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1527:9
-ERROR Object of class `FakeAccount` has no attribute `current_tenant_id` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1549:9
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1215:81
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_document.py:340:34
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `services.dataset_service.DocumentService.prepare_document_batch_download_zip` [bad-argument-type]

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 14, 2026
Merged via the queue into langgenius:main with commit 693080a Apr 14, 2026
27 of 28 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 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants