Repository navigation
refactor(api): replace json.loads with Pydantic validation in services layer - #33704
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the API's services layer by migrating from untyped Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 01:10:23.638555957 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 01:10:14.897623260 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:295:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 01:12:22.015725184 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 01:12:12.908743538 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2096:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2608:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2781:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:295:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
|
There was a problem hiding this comment.
Code Review
This pull request is a great refactoring that replaces raw json.loads() calls with Pydantic's validation methods across the services layer. This significantly improves type safety and data validation at the boundaries. My review focuses on a few opportunities to further enhance performance by optimizing the usage of Pydantic's TypeAdapter and simplifying data handling, which are consistent with the goals of this refactoring.
7f25c64 to
e3fb186
Compare
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 01:20:16.999105362 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 01:20:08.249102284 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:295:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 01:22:19.644214431 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 01:22:10.502139491 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2096:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2608:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2781:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:295:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 01:53:23.828845502 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 01:53:14.255909445 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2096:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2608:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2781:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:295:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5544,27 +5584,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5641,25 +5681,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 02:00:17.542363235 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 02:00:07.801391661 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -516,7 +548,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:297:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5544,27 +5584,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5641,25 +5681,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
a01c7be to
1224ec4
Compare
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 03:10:51.443396241 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 03:10:42.663400740 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -516,7 +548,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -549,8 +581,16 @@
--> services/external_knowledge_service.py:230:17
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
+ERROR Argument `dict[str, Any]` is not assignable to parameter `model_config` with type `AppModelConfigDict` in function `models.model.AppModelConfig.from_model_config_dict` [bad-argument-type]
+ --> services/message_service.py:297:76
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:414:62
+ERROR Could not find name `json` [unknown-name]
+ --> services/model_load_balancing_service.py:468:42
+ERROR Argument `object | Unknown` is not assignable to parameter `token` with type `str` in function `core.helper.encrypter.decrypt_token` [bad-argument-type]
+ --> services/model_load_balancing_service.py:586:79
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5544,27 +5584,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5641,25 +5681,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 03:14:37.982366312 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 03:14:27.902388662 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -516,7 +548,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -550,7 +582,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5544,27 +5576,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5641,25 +5673,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 03:53:41.559589426 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 03:53:32.597503495 +0000
@@ -12,6 +12,18 @@
--> controllers/console/app/site.py:122:5
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 Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:128:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:136:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:137:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:147:27
+ERROR Argument `Any | None` is not assignable to parameter `credential_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.reauthorize_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:153:31
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.datasource_provider_service.DatasourceProviderService.add_datasource_oauth_provider` [bad-argument-type]
+ --> controllers/console/datasets/rag_pipeline/datasource_auth.py:157:27
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
--> controllers/console/human_input_form.py:183:42
ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
@@ -32,6 +44,26 @@
--> controllers/console/setup.py:64:2
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
--> controllers/console/version.py:30:2
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:838:73
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:844:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:845:21
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:861:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.add_builtin_tool_provider` [bad-argument-type]
+ --> controllers/console/workspace/tool_providers.py:862:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_provider_service.TriggerProviderService.get_oauth_client` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:508:23
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:520:23
+ERROR Argument `Any | None` is not assignable to parameter `user_id` with type `str` in function `core.plugin.impl.oauth.OAuthHandler.get_credentials` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:521:21
+ERROR Argument `Any | None` is not assignable to parameter `tenant_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:537:23
+ERROR Argument `Any | None` is not assignable to parameter `subscription_builder_id` with type `str` in function `services.trigger.trigger_subscription_builder_service.TriggerSubscriptionBuilderService.update_trigger_subscription_builder` [bad-argument-type]
+ --> controllers/console/workspace/trigger_providers.py:539:37
ERROR `result` may be uninitialized [unbound-name]
--> controllers/service_api/app/annotation.py:55:16
ERROR Argument `WorkflowRun | None` is not assignable to parameter `workflow_run` with type `WorkflowRun` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
@@ -516,7 +548,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +560,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -550,7 +582,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5544,27 +5576,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5641,25 +5673,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
|
@asukaminato0721 would you review this PR? I am not sure why this fails always |
@dosu @gemini-code-assist how to fix this |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
These type errors occur because values like Fix: Add For datasource_auth.py (around lines 123-157), add assertions after retrieving from context: user_id = context.get("user_id")
tenant_id = context.get("tenant_id")
credential_id = context.get("credential_id")
assert tenant_id is not None
assert user_id is not None
# Add assert for credential_id where neededFor tool_providers.py (around lines 838-862) and trigger_providers.py (around lines 508-539), apply the same pattern. This matches existing patterns in the codebase, such as trigger_providers.py line 558 and workflow_trigger.py, where assertions are used to narrow types before calling service methods. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 10:20:42.216328908 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 10:20:32.922297144 +0000
@@ -516,7 +516,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +528,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -550,7 +550,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5554,27 +5554,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5651,25 +5651,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 18:12:40.533290341 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 18:12:30.418158170 +0000
@@ -516,7 +516,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +528,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -550,7 +550,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5532,27 +5532,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5629,25 +5629,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-19 18:15:34.720348413 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-19 18:15:25.949381304 +0000
@@ -516,7 +516,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1123:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:145:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -528,11 +528,11 @@
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> services/conversation_service.py:131:33
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2095:56
+ --> services/dataset_service.py:2098:56
ERROR `dict[str, bool | dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
- --> services/dataset_service.py:2607:44
+ --> services/dataset_service.py:2610:44
ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
- --> services/dataset_service.py:2780:51
+ --> services/dataset_service.py:2783:51
ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
--> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -550,7 +550,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:285:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -5532,27 +5532,27 @@
ERROR Argument `None` is not assignable to parameter `credentials` with type `dict[Unknown, Unknown]` in function `services.auth.api_key_auth_base.ApiKeyAuthBase.__init__` [bad-argument-type]
--> tests/unit_tests/services/auth/test_api_key_auth_base.py:48:35
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:128:24
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:129:24
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:133:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/services/auth/test_api_key_auth_service.py:134:16
+ERROR Cannot index into `str` [bad-index]
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:135:16
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:186:16
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:187:16
ERROR Cannot set item in `dict[str, dict[str, dict[str, str] | str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:271:31
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:272:31
ERROR Cannot delete item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:287:13
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:288:13
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:295:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:296:9
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:9
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:9
ERROR Cannot set item in `dict[str, dict[str, str] | str]` [unsupported-operation]
- --> tests/unit_tests/services/auth/test_api_key_auth_service.py:383:44
+ --> tests/unit_tests/services/auth/test_api_key_auth_service.py:384:44
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[KeyError], type[TypeError], type[AttributeError]]) [no-matching-overload]
--> tests/unit_tests/services/auth/test_auth_integration.py:142:27
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[HTTPError], type[Exception]]) [no-matching-overload]
@@ -5629,25 +5629,25 @@
ERROR `in` is not supported between `Literal['is not archived']` and `None` [not-iterable]
--> tests/unit_tests/services/retention/workflow_run/test_delete_archived_workflow_run.py:91:20
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Argument `None` is not assignable to parameter `name` with type `str` in function `_make_extension` [bad-argument-type]
--> tests/unit_tests/services/test_api_based_extension_service.py:230:46
ERROR Argument `None` is not assignable to parameter `api_endpoint` with type `str` in function `_make_extension` [bad-argument-type]
|
|
@asukaminato0721 I am having trouble with one ci failing... it keeps failing... would you help me? |
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-27 22:35:19.055398361 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-27 22:35:08.933365223 +0000
@@ -381,7 +381,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1131:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:143:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -415,7 +415,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:287:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -6635,26 +6635,28 @@
--> tests/unit_tests/services/plugin/test_oauth_service.py:68:34
ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
--> tests/unit_tests/services/plugin/test_oauth_service.py:95:9
+ERROR Argument `dict[str, int]` is not assignable to parameter `manifest` with type `ArchiveManifest` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._get_schema_version` [bad-argument-type]
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:341:41
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
--> tests/unit_tests/services/test_app_dsl_service.py:214:5
ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
|
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-27 22:37:01.973064927 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-27 22:36:51.310993351 +0000
@@ -381,7 +381,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1131:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:143:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -415,7 +415,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:287:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -6635,26 +6635,28 @@
--> tests/unit_tests/services/plugin/test_oauth_service.py:68:34
ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
--> tests/unit_tests/services/plugin/test_oauth_service.py:95:9
+ERROR Argument `dict[str, int]` is not assignable to parameter `manifest` with type `ArchiveManifest` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._get_schema_version` [bad-argument-type]
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:341:41
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
--> tests/unit_tests/services/test_app_dsl_service.py:214:5
ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
|
It happens on some users, and it doesn't affect merge so... well, nvm. |
@asukaminato0721 would you merge this so that I can put following PRs? |
|
Hi @asukaminato0721 would you merge this? |
https://github.com/langgenius/dify/pull/33704/changes#r3004203002 |
TypeAdapter(dict[str, str]) for icon parsing adds no meaningful validation over json.loads. Revert to json.loads per reviewer feedback.
Head branch was pushed to by a user without write access
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-30 06:37:16.495923739 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-30 06:37:06.562790455 +0000
@@ -381,7 +381,7 @@
ERROR No matching overload found for function `redis.client.Redis.__init__` called with arguments: (host=int | str | Unknown, port=int | str | Unknown, password=int | str | Unknown | None, db=int, ssl=bool, ssl_ca_certs=str | None, ssl_cert_reqs=Any | None, ssl_certfile=Any | None, ssl_keyfile=Any | None, socket_timeout=Literal[5], socket_connect_timeout=Literal[5], health_check_interval=Literal[30]) [no-matching-overload]
--> schedule/queue_monitor_task.py:14:21
ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
- --> services/account_service.py:1121:13
+ --> services/account_service.py:1131:13
ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Iterable[bytes]` [unsafe-overlap]
--> services/audio_service.py:143:41
ERROR No matching overload found for function `flask.helpers.stream_with_context` called with arguments: (Generator[bytes]) [no-matching-overload]
@@ -415,7 +415,7 @@
ERROR Returned type `dict[Unknown, Unknown] | None` is not assignable to declared return type `dict[str, Any]` [bad-return]
--> services/external_knowledge_service.py:232:16
ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
- --> services/plugin/plugin_migration.py:72:34
+ --> services/plugin/plugin_migration.py:82:34
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> services/summary_index_service.py:287:29
ERROR Object of class `NoneType` has no attribute `summary_index_node_id` [missing-attribute]
@@ -6647,26 +6647,28 @@
--> tests/unit_tests/services/plugin/test_oauth_service.py:68:34
ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
--> tests/unit_tests/services/plugin/test_oauth_service.py:95:9
+ERROR Argument `dict[str, int]` is not assignable to parameter `manifest` with type `ArchiveManifest` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._get_schema_version` [bad-argument-type]
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:341:41
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:612:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:613:67
ERROR `in` is not supported between `Literal['Storage not configured']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:615:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:616:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:629:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:630:67
ERROR `in` is not supported between `Literal['Archive bundle not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:632:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:633:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:652:63
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:653:63
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:708:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:709:71
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:734:67
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:735:67
ERROR `in` is not supported between `Literal['File is not a zip file']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:738:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:739:16
ERROR Argument `() -> Mock` is not assignable to parameter `session_maker` with type `sessionmaker[Unknown]` in function `services.retention.workflow_run.restore_archived_workflow_run.WorkflowRunRestore._restore_from_run` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:758:71
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:759:71
ERROR `in` is not supported between `Literal['not found']` and `None` [not-iterable]
- --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:905:16
+ --> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:906:16
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
--> tests/unit_tests/services/test_app_dsl_service.py:214:5
ERROR Object of class `FunctionType` has no attribute `assert_called_once` [missing-attribute]
|
Looks good now? |
|
Thank you @asukaminato0721 |
…s layer (langgenius#33704) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Summary
Replace raw json.loads calls with Pydantic validate_json and model_validate_json across 14 service files for type-safe JSON deserialization.
Why this change
The services layer used bare json.loads which returns untyped dicts, bypassing runtime validation. Pydantic's validate_json gives schema validation on deserialization and typed return values for static type checkers.
Key patterns applied
Test plan
Part of #33092