Skip to content

refactor(models): improve Dataset ORM typing with Mapped[...] annotations#32644

Open
VignanNallani wants to merge 7 commits intolanggenius:mainfrom
VignanNallani:refactor/dataset-orm-typing-clean
Open

refactor(models): improve Dataset ORM typing with Mapped[...] annotations#32644
VignanNallani wants to merge 7 commits intolanggenius:mainfrom
VignanNallani:refactor/dataset-orm-typing-clean

Conversation

@VignanNallani
Copy link
Copy Markdown

Summary

Improves ORM typing for the Dataset model by replacing untyped mapped_column declarations with SQLAlchemy 2.0 Mapped[...] annotations.

Motivation

Part of the incremental typing improvements discussed in #22652.

Scope

  • Dataset model only
  • No behavioral changes
  • No schema changes
  • Pure typing enhancement

Notes

Follows SQLAlchemy 2.0 migration guidance for typed ORM models.

This change is strictly type-level and does not affect runtime behavior or database schema.

…ions

- Replace untyped mapped_column fields with proper Mapped[...] typing
- Follow SQLAlchemy 2.0 typing best practices
- Add explicit type annotations for str, int, bool, datetime, dict[str, Any]
- Maintain backward compatibility and nullable field semantics
- Focus on Dataset model as incremental improvement

Addresses part of langgenius#22652 better orm typing
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Feb 26, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @VignanNallani, 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 Dataset ORM model by adopting SQLAlchemy 2.0's Mapped[...] annotations for column declarations. This change significantly enhances the type safety and clarity of the model definition, aligning with ongoing efforts to improve incremental typing across the codebase. The modifications are purely type-level and do not introduce any behavioral or schema changes.

Highlights

  • Improved ORM Typing: The Dataset model's ORM typing has been significantly improved by adopting SQLAlchemy 2.0's Mapped[...] annotations.
  • Type Annotation Consistency: Untyped mapped_column declarations were replaced with explicit type hints, enhancing type safety and code clarity for various columns.
  • No Behavioral or Schema Changes: This refactoring is purely a type-level enhancement and does not introduce any changes to runtime behavior or the database schema.

🧠 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.

Changelog
  • api/models/dataset.py
    • Updated column declarations to use Mapped[...] annotations.
    • Added explicit type hints for description, data_source_type, index_struct, created_by, updated_by, updated_at, embedding_model, embedding_model_provider, keyword_number, collection_binding_id, retrieval_model, summary_index_setting, built_in_field_enabled, icon_info, runtime_mode, pipeline_id, chunk_structure, enable_api, and is_multimodal.
Activity
  • No activity has been recorded yet for this pull request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Dataset ORM model to use Mapped[...] annotations for its column definitions, which aligns with modern SQLAlchemy 2.0 typing practices. The changes are confined to adding type hints to the attributes of the Dataset model. The new type annotations have been reviewed and they accurately reflect the column definitions, including their nullability. No issues were found in this update.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

Pyrefly Diff

base → PR
1,4d0
< Downloading nltk (1.5MiB)
<  Downloaded nltk
< Uninstalled 2 packages in 7ms
< Installed 2 packages in 13ms
37c33
< ERROR Argument `((*args: Unknown, **kwargs: Unknown) -> ((dict[str, Any], StartResponse) -> Iterable[bytes]) | AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | OrderedDict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | OrderedDict[Unknown, list[Unknown]] | OrderedDict[Unknown, Unknown] | Response | bytes | dict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | dict[Unknown, list[Unknown]] | dict[Unknown, Unknown] | list[Any] | list[Unknown] | str | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, Headers | Mapping[str, list[str] | str | tuple[str, ...]] | Sequence[tuple[str, list[str] | str | tuple[str, ...]]]] | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, int] | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, int, Headers | Mapping[str, list[str] | str | tuple[str, ...]] | Sequence[tuple[str, list[str] | str | tuple[str, ...]]]] | tuple[OrderedDict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | OrderedDict[Unknown, list[Unknown]] | OrderedDict[Unknown, Unknown] | dict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | dict[Unknown, list[Unknown]] | dict[Unknown, Unknown] | list[Unknown], HTTPStatus | Unknown, dict[Unknown, Unknown] | Unknown]) | [P1, R1](view_func: (ParamSpec(P1)) -> R1) -> (ParamSpec(P1)) -> R1` is not assignable to parameter `view` with type `(*args: Unknown, **kwargs: Unknown) -> ((dict[str, Any], StartResponse) -> Iterable[bytes]) | AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | OrderedDict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | OrderedDict[Unknown, list[Unknown]] | OrderedDict[Unknown, Unknown] | Response | bytes | dict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | dict[Unknown, list[Unknown]] | dict[Unknown, Unknown] | list[Any] | list[Unknown] | str | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, Headers | Mapping[str, list[str] | str | tuple[str, ...]] | Sequence[tuple[str, list[str] | str | tuple[str, ...]]]] | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, int] | tuple[AsyncIterable[bytes] | AsyncIterable[str] | Iterator[bytes] | Iterator[str] | Mapping[str, Any] | Response | bytes | list[Any] | str, int, Headers | Mapping[str, list[str] | str | tuple[str, ...]] | Sequence[tuple[str, list[str] | str | tuple[str, ...]]]] | tuple[OrderedDict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | OrderedDict[Unknown, list[Unknown]] | OrderedDict[Unknown, Unknown] | dict[Unknown, OrderedDict[Unknown, Unknown] | dict[Unknown, Unknown]] | dict[Unknown, list[Unknown]] | dict[Unknown, Unknown] | list[Unknown], HTTPStatus | Unknown, dict[Unknown, Unknown] | Unknown]` in function `controllers.console.wraps.account_initialization_required` [bad-argument-type]
---
> ERROR Argument `((*args: Unknown, **kwargs: Unknown) -> Unknown) | [P1, R1](view_func: (ParamSpec(P1)) -> R1) -> (ParamSpec(P1)) -> R1` is not assignable to parameter `view` with type `(*args: Unknown, **kwargs: Unknown) -> Unknown` in function `controllers.console.wraps.account_initialization_required` [bad-argument-type]
60a57,104
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:288:30
>     |
> 288 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:290:27
>     |
> 290 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:341:30
>     |
> 341 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:343:27
>     |
> 343 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:392:30
>     |
> 392 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:394:27
>     |
> 394 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:577:30
>     |
> 577 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:579:27
>     |
> 579 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
168a213,260
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:111:30
>     |
> 111 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:113:27
>     |
> 113 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:165:30
>     |
> 165 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:167:27
>     |
> 167 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:271:30
>     |
> 271 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:273:27
>     |
> 273 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:366:30
>     |
> 366 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:368:27
>     |
> 368 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
208a301,312
> ERROR This `yield` expression is unreachable [unreachable]
>    --> core/app/apps/advanced_chat/generate_task_pipeline.py:673:9
>     |
> 673 |         yield  # Make this a generator
>     |         ^^^^^
>     |
> ERROR This `yield` expression is unreachable [unreachable]
>    --> core/app/apps/advanced_chat/generate_task_pipeline.py:681:9
>     |
> 681 |         yield  # Make this a generator
>     |         ^^^^^
>     |
210c314
<    --> core/app/apps/advanced_chat/generate_task_pipeline.py:960:19
---
>    --> core/app/apps/advanced_chat/generate_task_pipeline.py:962:19
212c316
< 960 |             files=self._recorded_files,
---
> 962 |             files=self._recorded_files,
216c320
<    --> core/app/apps/advanced_chat/generate_task_pipeline.py:961:22
---
>    --> core/app/apps/advanced_chat/generate_task_pipeline.py:963:22
218c322
< 961 |             metadata=extras,
---
> 963 |             metadata=extras,
417a522,527
> ERROR Argument `str | None` is not assignable to parameter `document_form` with type `str` in function `PipelineGenerator._build_document` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:148:35
>     |
> 148 |                     document_form=dataset.chunk_structure,
>     |                                   ^^^^^^^^^^^^^^^^^^^^^^^
>     |
435a546,557
> ERROR Argument `str | None` is not assignable to parameter `description` with type `bytearray | bytes | str` in function `core.entities.knowledge_entities.PipelineDataset.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:254:29
>     |
> 254 |                 description=dataset.description,
>     |                             ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `chunk_structure` with type `bytearray | bytes | str` in function `core.entities.knowledge_entities.PipelineDataset.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:255:33
>     |
> 255 |                 chunk_structure=dataset.chunk_structure,
>     |                                 ^^^^^^^^^^^^^^^^^^^^^^^
>     |
687,698d808
< ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/datasource/datasource_manager.py:322:28
<     |
< 322 |                     inputs=parameters_for_log,
<     |                            ^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/datasource/datasource_manager.py:331:28
<     |
< 331 |                     inputs=parameters_for_log,
<     |                            ^^^^^^^^^^^^^^^^^^
<     |
710a821,844
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:296:31
>     |
> 296 |                         model=dataset.embedding_model,
>     |                               ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:576:26
>     |
> 576 |                 provider=dataset.embedding_model_provider,
>     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:578:23
>     |
> 578 |                 model=dataset.embedding_model,
>     |                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:770:27
>     |
> 770 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
854a989,994
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/aliyun_trace/aliyun_trace.py:73:9
>    |
> 73 |         super().__init__(aliyun_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
872a1013,1036
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>    --> core/ops/arize_phoenix_trace/arize_phoenix_trace.py:163:9
>     |
> 163 |         super().__init__(arize_phoenix_config)
>     |         ^^^^^^^^^^^^^^^^
>     |
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/langfuse_trace/langfuse_trace.py:44:9
>    |
> 44 |         super().__init__(langfuse_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/langsmith_trace/langsmith_trace.py:43:9
>    |
> 43 |         super().__init__(langsmith_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/mlflow_trace/mlflow_trace.py:43:9
>    |
> 43 |         super().__init__(config)
>    |         ^^^^^^^^^^^^^^^^
>    |
928a1093,1105
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/opik_trace/opik_trace.py:71:9
>    |
> 71 |         super().__init__(opik_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
> ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
>   --> core/ops/ops_trace_manager.py:44:9
>    |
> 44 |     def __getitem__(self, provider: str) -> dict[str, Any]:
>    |         ^^^^^^^^^^^
>    |
>   Got parameter name `provider`, expected `key`
1007a1185,1190
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/tencent_trace/tencent_trace.py:44:9
>    |
> 44 |         super().__init__(tencent_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
1025a1209,1214
> ERROR Method `__init__` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
>   --> core/ops/weave_trace/weave_trace.py:46:9
>    |
> 46 |         super().__init__(weave_config)
>    |         ^^^^^^^^^^^^^^^^
>    |
1160a1350,1355
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `external_retrieval_parameters` with type `dict[Unknown, Unknown]` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
>   --> core/tools/utils/dataset_retriever/dataset_retriever_tool.py:88:47
>    |
> 88 |                 external_retrieval_parameters=dataset.retrieval_model,
>    |                                               ^^^^^^^^^^^^^^^^^^^^^^^
>    |
1208a1404,1409
> ERROR Pyrefly detected conflicting types while breaking a dependency cycle: `(t: SegmentType) -> Segment` is not assignable to `str`. Adding explicit type annotations might possibly help. [bad-assignment]
>    --> core/variables/types.py:222:9
>     |
> 222 |     def get_zero_value(t: SegmentType):
>     |         ^^^^^^^^^^^^^^
>     |
1432c1633
<    --> core/workflow/nodes/code/code_node.py:131:102
---
>    --> core/workflow/nodes/code/code_node.py:114:102
1434c1635
< 131 |         return NodeRunResult(status=WorkflowNodeExecutionStatus.SUCCEEDED, inputs=variables, outputs=result)
---
> 114 |         return NodeRunResult(status=WorkflowNodeExecutionStatus.SUCCEEDED, inputs=variables, outputs=result)
1438c1639
<    --> core/workflow/nodes/datasource/datasource_node.py:125:36
---
>    --> core/workflow/nodes/datasource/datasource_node.py:138:36
1440c1641
< 125 | ...                   inputs=parameters_for_log,
---
> 138 | ...                   inputs=parameters_for_log,
1444c1645
<    --> core/workflow/nodes/datasource/datasource_node.py:146:36
---
>    --> core/workflow/nodes/datasource/datasource_node.py:173:36
1446c1647
< 146 | ...                   inputs=parameters_for_log,
---
> 173 | ...                   inputs=parameters_for_log,
1450c1651
<    --> core/workflow/nodes/datasource/datasource_node.py:160:28
---
>    --> core/workflow/nodes/datasource/datasource_node.py:187:28
1452c1653
< 160 |                     inputs=parameters_for_log,
---
> 187 |                     inputs=parameters_for_log,
1456c1657
<    --> core/workflow/nodes/datasource/datasource_node.py:170:28
---
>    --> core/workflow/nodes/datasource/datasource_node.py:197:28
1458c1659
< 170 |                     inputs=parameters_for_log,
---
> 197 |                     inputs=parameters_for_log,
1460a1662,1673
> ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/datasource/datasource_node.py:428:24
>     |
> 428 |                 inputs=parameters_for_log,
>     |                        ^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/datasource/datasource_node.py:485:24
>     |
> 485 |                 inputs=parameters_for_log,
>     |                        ^^^^^^^^^^^^^^^^^^
>     |
1612c1825,1831
< ERROR Argument `list[dict[str, Any]]` is not assignable to parameter `value` with type `Iterable[Mapping[LaxStr, Any]]` in function `core.workflow.variables.segments.ArrayObjectSegment.__init__` [bad-argument-type]
---
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
>    --> core/workflow/nodes/knowledge_index/knowledge_index_node.py:283:98
>     |
> 283 | ...                   SummaryIndexService.generate_and_vectorize_summary(segment, dataset, summary_index_setting)
>     |                                                                                            ^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `list[dict[str, Any]]` is not assignable to parameter `value` with type `Iterable[Mapping[LaxStr, Any]]` in function `core.variables.segments.ArrayObjectSegment.__init__` [bad-argument-type]
1721c1940
<    --> core/workflow/nodes/llm/node.py:319:28
---
>    --> core/workflow/nodes/llm/node.py:320:28
1723c1942
< 319 |                     inputs=node_inputs,
---
> 320 |                     inputs=node_inputs,
1727c1946
<    --> core/workflow/nodes/llm/node.py:320:34
---
>    --> core/workflow/nodes/llm/node.py:321:34
1729c1948
< 320 |                     process_data=process_data,
---
> 321 |                     process_data=process_data,
1733c1952
<    --> core/workflow/nodes/llm/node.py:321:29
---
>    --> core/workflow/nodes/llm/node.py:322:29
1735c1954
< 321 |                     outputs=outputs,
---
> 322 |                     outputs=outputs,
1739c1958
<    --> core/workflow/nodes/llm/node.py:335:28
---
>    --> core/workflow/nodes/llm/node.py:336:28
1741c1960
< 335 |                     inputs=node_inputs,
---
> 336 |                     inputs=node_inputs,
1745c1964
<    --> core/workflow/nodes/llm/node.py:336:34
---
>    --> core/workflow/nodes/llm/node.py:337:34
1747c1966
< 336 |                     process_data=process_data,
---
> 337 |                     process_data=process_data,
1751c1970
<    --> core/workflow/nodes/llm/node.py:347:28
---
>    --> core/workflow/nodes/llm/node.py:348:28
1753c1972
< 347 |                     inputs=node_inputs,
---
> 348 |                     inputs=node_inputs,
1757c1976
<    --> core/workflow/nodes/llm/node.py:348:34
---
>    --> core/workflow/nodes/llm/node.py:349:34
1759c1978
< 348 |                     process_data=process_data,
---
> 349 |                     process_data=process_data,
1763c1982
<    --> core/workflow/nodes/llm/node.py:877:65
---
>    --> core/workflow/nodes/llm/node.py:899:65
1765c1984
< 877 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
---
> 899 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
1773c1992
<    --> core/workflow/nodes/llm/node.py:877:65
---
>    --> core/workflow/nodes/llm/node.py:899:65
1775c1994
< 877 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
---
> 899 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
1783c2002
<    --> core/workflow/nodes/llm/node.py:894:65
---
>    --> core/workflow/nodes/llm/node.py:916:65
1785c2004
< 894 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
---
> 916 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
1793c2012
<    --> core/workflow/nodes/llm/node.py:894:65
---
>    --> core/workflow/nodes/llm/node.py:916:65
1795c2014
< 894 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
---
> 916 |                 prompt_messages[-1] = UserPromptMessage(content=file_prompts + prompt_messages[-1].content)
1845c2064
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:234:24
---
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:213:24
1847c2066
< 234 |                 inputs=inputs,
---
> 213 |                 inputs=inputs,
1850,1851c2069,2070
< ERROR Argument `dict[str, LLMMode | dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:235:30
---
> ERROR Argument `dict[str, dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:214:30
1853c2072
< 235 |                 process_data=process_data,
---
> 214 |                 process_data=process_data,
1857c2076
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:243:24
---
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:222:24
1859c2078
< 243 |                 inputs=inputs,
---
> 222 |                 inputs=inputs,
1862,1863c2081,2082
< ERROR Argument `dict[str, LLMMode | dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:244:30
---
> ERROR Argument `dict[str, dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:223:30
1865c2084
< 244 |                 process_data=process_data,
---
> 223 |                 process_data=process_data,
1869c2088
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:270:20
---
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:249:20
1871c2090
< 270 |             inputs=inputs,
---
> 249 |             inputs=inputs,
1874,1875c2093,2094
< ERROR Argument `dict[str, LLMMode | dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:271:26
---
> ERROR Argument `dict[str, dict[Unknown, Unknown] | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/parameter_extractor/parameter_extractor_node.py:250:26
1877c2096
< 271 |             process_data=process_data,
---
> 250 |             process_data=process_data,
1881c2100
<    --> core/workflow/nodes/question_classifier/question_classifier_node.py:218:24
---
>    --> core/workflow/nodes/question_classifier/question_classifier_node.py:208:24
1883c2102
< 218 |                 inputs=variables,
---
> 208 |                 inputs=variables,
1886,1887c2105,2106
< ERROR Argument `dict[str, LLMMode | list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
<    --> core/workflow/nodes/question_classifier/question_classifier_node.py:219:30
---
> ERROR Argument `dict[str, list[Unknown] | str | Any | None]` is not assignable to parameter `process_data` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
>    --> core/workflow/nodes/question_classifier/question_classifier_node.py:209:30
1889c2108
< 219 |                 process_data=process_data,
---
> 209 |                 process_data=process_data,
1893c2112
<    --> core/workflow/nodes/question_classifier/question_classifier_node.py:220:25
---
>    --> core/workflow/nodes/question_classifier/question_classifier_node.py:210:25
1895c2114
< 220 |                 outputs=outputs,
---
> 210 |                 outputs=outputs,
1899c2118
<    --> core/workflow/nodes/question_classifier/question_classifier_node.py:232:24
---
>    --> core/workflow/nodes/question_classifier/question_classifier_node.py:222:24
1901c2120
< 232 |                 inputs=variables,
---
> 222 |                 inputs=variables,
2072,2077d2290
< ERROR Pyrefly detected conflicting types while breaking a dependency cycle: `(t: SegmentType) -> Segment` is not assignable to `str`. Adding explicit type annotations might possibly help. [bad-assignment]
<    --> core/workflow/variables/types.py:222:9
<     |
< 222 |     def get_zero_value(t: SegmentType):
<     |         ^^^^^^^^^^^^^^
<     |
2085c2298
<    --> core/workflow/workflow_entry.py:297:26
---
>    --> core/workflow/workflow_entry.py:296:26
2087c2300
< 297 |             graph_config=graph_dict,
---
> 296 |             graph_config=graph_dict,
2089a2303,2314
> ERROR Argument `str | None` is not assignable to parameter `index_struct` with type `str` in function `celery.app.task.Task.delay` [bad-argument-type]
>   --> events/event_handlers/clean_when_dataset_deleted.py:15:9
>    |
> 15 |         dataset.index_struct,
>    |         ^^^^^^^^^^^^^^^^^^^^
>    |
> ERROR Argument `str | None` is not assignable to parameter `collection_binding_id` with type `str` in function `celery.app.task.Task.delay` [bad-argument-type]
>   --> events/event_handlers/clean_when_dataset_deleted.py:16:9
>    |
> 16 |         dataset.collection_binding_id,
>    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    |
2588c2813
<   --> libs/login.py:85:35
---
>   --> libs/login.py:83:35
2590c2815
< 85 |         check_csrf_token(request, current_user.id)
---
> 83 |         check_csrf_token(request, current_user.id)
2867c3092
<     --> services/dataset_service.py:2073:56
---
>     --> services/dataset_service.py:2063:56
2869c3094
< 2073 |   ...                   data_source_info = {
---
> 2063 |   ...                   data_source_info = {
2871,2875c3096,3100
< 2074 | | ...                       "credential_id": notion_info.credential_id,
< 2075 | | ...                       "notion_workspace_id": workspace_id,
< 2076 | | ...                       "notion_page_id": page.page_id,
< 2077 | | ...                       "notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,  # type: ignore
< 2078 | | ...                       "type": page.type,
---
> 2064 | | ...                       "credential_id": notion_info.credential_id,
> 2065 | | ...                       "notion_workspace_id": workspace_id,
> 2066 | | ...                       "notion_page_id": page.page_id,
> 2067 | | ...                       "notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,  # type: ignore
> 2068 | | ...                       "type": page.type,
2879c3104
<     --> services/dataset_service.py:2585:44
---
>     --> services/dataset_service.py:2575:44
2881c3106
< 2585 |                           data_source_info = {
---
> 2575 |                           data_source_info = {
2883,2887c3108,3112
< 2586 | |                             "credential_id": notion_info.credential_id,
< 2587 | |                             "notion_workspace_id": workspace_id,
< 2588 | |                             "notion_page_id": page.page_id,
< 2589 | |                             "notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,  # type: ignore
< 2590 | |                             "type": page.type,
---
> 2576 | |                             "credential_id": notion_info.credential_id,
> 2577 | |                             "notion_workspace_id": workspace_id,
> 2578 | |                             "notion_page_id": page.page_id,
> 2579 | |                             "notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,  # type: ignore
> 2580 | |                             "type": page.type,
2889a3115,3162
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3099:26
>      |
> 3099 |                 provider=dataset.embedding_model_provider,
>      |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3101:23
>      |
> 3101 |                 model=dataset.embedding_model,
>      |                       ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3182:34
>      |
> 3182 |                         provider=dataset.embedding_model_provider,
>      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3184:31
>      |
> 3184 |                         model=dataset.embedding_model,
>      |                               ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3324:39
>      |
> 3324 | ...                   model=dataset.embedding_model,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3383:34
>      |
> 3383 |                         provider=dataset.embedding_model_provider,
>      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3385:31
>      |
> 3385 |                         model=dataset.embedding_model,
>      |                               ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3428:39
>      |
> 3428 | ...                   model=dataset.embedding_model,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
2950a3224,3265
> ERROR Argument `str | None` is not assignable to parameter `chunk_structure` with type `SQLCoreOperations[str] | str` in function `models.dataset.PipelineCustomizedTemplate.__init__` [bad-argument-type]
>     --> services/rag_pipeline/rag_pipeline.py:1161:29
>      |
> 1161 |             chunk_structure=dataset.chunk_structure,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR `str | None` is not assignable to attribute `embedding_model` with type `str` [bad-assignment]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:168:55
>     |
> 168 |             knowledge_configuration.embedding_model = dataset.embedding_model
>     |                                                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR `str | None` is not assignable to attribute `embedding_model_provider` with type `str` [bad-assignment]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:169:64
>     |
> 169 |             knowledge_configuration.embedding_model_provider = dataset.embedding_model_provider
>     |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `description` with type `SQLCoreOperations[str] | str` in function `models.dataset.Pipeline.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:279:25
>     |
> 279 |             description=dataset.description,
>     |                         ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:329:41
>     |
> 329 | ...                   pipeline_id=dataset.pipeline_id,
>     |                                   ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:357:33
>     |
> 357 |                     pipeline_id=dataset.pipeline_id,
>     |                                 ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:386:33
>     |
> 386 |                     pipeline_id=dataset.pipeline_id,
>     |                                 ^^^^^^^^^^^^^^^^^^^
>     |
3022a3338,3349
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> services/summary_index_service.py:195:26
>     |
> 195 |                 provider=dataset.embedding_model_provider,
>     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> services/summary_index_service.py:197:23
>     |
> 197 |                 model=dataset.embedding_model,
>     |                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
3154a3482,3487
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>   --> services/vector_service.py:57:35
>    |
> 57 | ...                   model=dataset.embedding_model,
>    |                             ^^^^^^^^^^^^^^^^^^^^^^^
>    |
3242a3576,3581
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
>    --> tasks/regenerate_summary_index_task.py:262:55
>     |
> 262 | ...                   segment, dataset, summary_index_setting
>     |                                         ^^^^^^^^^^^^^^^^^^^^^
>     |
3286c3625
<  INFO 449 errors (167 suppressed)
---
>  INFO 506 errors (167 suppressed)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

Pyrefly Diff

base → PR
56a57,104
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:288:30
>     |
> 288 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:290:27
>     |
> 290 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:341:30
>     |
> 341 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:343:27
>     |
> 343 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:392:30
>     |
> 392 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:394:27
>     |
> 394 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:577:30
>     |
> 577 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/console/datasets/datasets_segments.py:579:27
>     |
> 579 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
164a213,260
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:111:30
>     |
> 111 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:113:27
>     |
> 113 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:165:30
>     |
> 165 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:167:27
>     |
> 167 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:271:30
>     |
> 271 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:273:27
>     |
> 273 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:366:30
>     |
> 366 |                     provider=dataset.embedding_model_provider,
>     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> controllers/service_api/dataset/segment.py:368:27
>     |
> 368 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
413a510,515
> ERROR Argument `str | None` is not assignable to parameter `document_form` with type `str` in function `PipelineGenerator._build_document` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:148:35
>     |
> 148 |                     document_form=dataset.chunk_structure,
>     |                                   ^^^^^^^^^^^^^^^^^^^^^^^
>     |
431a534,545
> ERROR Argument `str | None` is not assignable to parameter `description` with type `bytearray | bytes | str` in function `core.entities.knowledge_entities.PipelineDataset.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:254:29
>     |
> 254 |                 description=dataset.description,
>     |                             ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `chunk_structure` with type `bytearray | bytes | str` in function `core.entities.knowledge_entities.PipelineDataset.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_generator.py:255:33
>     |
> 255 |                 chunk_structure=dataset.chunk_structure,
>     |                                 ^^^^^^^^^^^^^^^^^^^^^^^
>     |
706a821,844
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:296:31
>     |
> 296 |                         model=dataset.embedding_model,
>     |                               ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:576:26
>     |
> 576 |                 provider=dataset.embedding_model_provider,
>     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:578:23
>     |
> 578 |                 model=dataset.embedding_model,
>     |                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> core/indexing_runner.py:770:27
>     |
> 770 |                     model=dataset.embedding_model,
>     |                           ^^^^^^^^^^^^^^^^^^^^^^^
>     |
1156a1295,1300
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `external_retrieval_parameters` with type `dict[Unknown, Unknown]` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
>   --> core/tools/utils/dataset_retriever/dataset_retriever_tool.py:88:47
>    |
> 88 |                 external_retrieval_parameters=dataset.retrieval_model,
>    |                                               ^^^^^^^^^^^^^^^^^^^^^^^
>    |
1607a1752,1757
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
>    --> core/workflow/nodes/knowledge_index/knowledge_index_node.py:283:98
>     |
> 283 | ...                   SummaryIndexService.generate_and_vectorize_summary(segment, dataset, summary_index_setting)
>     |                                                                                            ^^^^^^^^^^^^^^^^^^^^^
>     |
2085a2236,2247
> ERROR Argument `str | None` is not assignable to parameter `index_struct` with type `str` in function `celery.app.task.Task.delay` [bad-argument-type]
>   --> events/event_handlers/clean_when_dataset_deleted.py:15:9
>    |
> 15 |         dataset.index_struct,
>    |         ^^^^^^^^^^^^^^^^^^^^
>    |
> ERROR Argument `str | None` is not assignable to parameter `collection_binding_id` with type `str` in function `celery.app.task.Task.delay` [bad-argument-type]
>   --> events/event_handlers/clean_when_dataset_deleted.py:16:9
>    |
> 16 |         dataset.collection_binding_id,
>    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    |
2885a3048,3095
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3109:26
>      |
> 3109 |                 provider=dataset.embedding_model_provider,
>      |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3111:23
>      |
> 3111 |                 model=dataset.embedding_model,
>      |                       ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3192:34
>      |
> 3192 |                         provider=dataset.embedding_model_provider,
>      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3194:31
>      |
> 3194 |                         model=dataset.embedding_model,
>      |                               ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3334:39
>      |
> 3334 | ...                   model=dataset.embedding_model,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3393:34
>      |
> 3393 |                         provider=dataset.embedding_model_provider,
>      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3395:31
>      |
> 3395 |                         model=dataset.embedding_model,
>      |                               ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>     --> services/dataset_service.py:3438:39
>      |
> 3438 | ...                   model=dataset.embedding_model,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
2946a3157,3198
> ERROR Argument `str | None` is not assignable to parameter `chunk_structure` with type `SQLCoreOperations[str] | str` in function `models.dataset.PipelineCustomizedTemplate.__init__` [bad-argument-type]
>     --> services/rag_pipeline/rag_pipeline.py:1161:29
>      |
> 1161 |             chunk_structure=dataset.chunk_structure,
>      |                             ^^^^^^^^^^^^^^^^^^^^^^^
>      |
> ERROR `str | None` is not assignable to attribute `embedding_model` with type `str` [bad-assignment]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:168:55
>     |
> 168 |             knowledge_configuration.embedding_model = dataset.embedding_model
>     |                                                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR `str | None` is not assignable to attribute `embedding_model_provider` with type `str` [bad-assignment]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:169:64
>     |
> 169 |             knowledge_configuration.embedding_model_provider = dataset.embedding_model_provider
>     |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `description` with type `SQLCoreOperations[str] | str` in function `models.dataset.Pipeline.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:279:25
>     |
> 279 |             description=dataset.description,
>     |                         ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:329:41
>     |
> 329 | ...                   pipeline_id=dataset.pipeline_id,
>     |                                   ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:357:33
>     |
> 357 |                     pipeline_id=dataset.pipeline_id,
>     |                                 ^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `pipeline_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.DocumentPipelineExecutionLog.__init__` [bad-argument-type]
>    --> services/rag_pipeline/rag_pipeline_transform_service.py:386:33
>     |
> 386 |                     pipeline_id=dataset.pipeline_id,
>     |                                 ^^^^^^^^^^^^^^^^^^^
>     |
3018a3271,3282
> ERROR Argument `str | None` is not assignable to parameter `provider` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> services/summary_index_service.py:195:26
>     |
> 195 |                 provider=dataset.embedding_model_provider,
>     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     |
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>    --> services/summary_index_service.py:197:23
>     |
> 197 |                 model=dataset.embedding_model,
>     |                       ^^^^^^^^^^^^^^^^^^^^^^^
>     |
3150a3415,3420
> ERROR Argument `str | None` is not assignable to parameter `model` with type `str` in function `core.model_manager.ModelManager.get_model_instance` [bad-argument-type]
>   --> services/vector_service.py:57:35
>    |
> 57 | ...                   model=dataset.embedding_model,
>    |                             ^^^^^^^^^^^^^^^^^^^^^^^
>    |
3238a3509,3514
> ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
>    --> tasks/regenerate_summary_index_task.py:262:55
>     |
> 262 | ...                   segment, dataset, summary_index_setting
>     |                                         ^^^^^^^^^^^^^^^^^^^^^
>     |
3282c3558
<  INFO 449 errors (167 suppressed)
---
>  INFO 495 errors (167 suppressed)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Pyrefly Diff

base → PR
1,6d0
< Downloading google-cloud-aiplatform (7.8MiB)
< Downloading grpcio-tools (2.4MiB)
<  Downloaded grpcio-tools
<  Downloaded google-cloud-aiplatform
< Uninstalled 30 packages in 48ms
< Installed 31 packages in 97ms
205c199
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
438,439c432,433
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `datasource_info` with type `Mapping[LaxStr, Any] | None` in function `dify_graph.system_variable.SystemVariable.__init__` [bad-argument-type]
<    --> core/app/apps/pipeline/pipeline_runner.py:124:33
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `datasource_info` with type `Mapping[LaxStr, Any] | None` in function `core.workflow.system_variable.SystemVariable.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_runner.py:125:33
441c435
< 124 |                 datasource_info=self.application_generate_entity.datasource_info,
---
> 125 |                 datasource_info=self.application_generate_entity.datasource_info,
444,445c438,439
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
<    --> core/app/apps/pipeline/pipeline_runner.py:145:29
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_runner.py:146:29
447c441
< 145 |                 user_inputs=inputs,
---
> 146 |                 user_inputs=inputs,
450,451c444,445
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `dify_graph.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
<    --> core/app/apps/pipeline/pipeline_runner.py:262:26
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `core.workflow.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
>    --> core/app/apps/pipeline/pipeline_runner.py:263:26
453c447
< 262 |             graph_config=graph_config,
---
> 263 |             graph_config=graph_config,
462c456
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `user_inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.runtime.variable_pool.VariablePool.__init__` [bad-argument-type]
480c474
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `dify_graph.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `core.workflow.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
486c480
< ERROR Argument `dict[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `dify_graph.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
---
> ERROR Argument `dict[str, Any]` is not assignable to parameter `graph_config` with type `Mapping[LaxStr, Any]` in function `core.workflow.entities.graph_init_params.GraphInitParams.__init__` [bad-argument-type]
689c683
< ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.node_events.base.NodeRunResult.__init__` [bad-argument-type]
---
> ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
695c689
< ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.node_events.base.NodeRunResult.__init__` [bad-argument-type]
---
> ERROR Argument `dict[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `core.workflow.node_events.base.NodeRunResult.__init__` [bad-argument-type]
833c827
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `dify_graph.model_runtime.entities.llm_entities.LLMResultWithStructuredOutput.__init__` [bad-argument-type]
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `core.model_runtime.entities.llm_entities.LLMResultWithStructuredOutput.__init__` [bad-argument-type]
845c839
< ERROR Argument `Mapping[str, Any]` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `dify_graph.model_runtime.entities.llm_entities.LLMResultChunkWithStructuredOutput.__init__` [bad-argument-type]
---
> ERROR Argument `Mapping[str, Any]` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `core.model_runtime.entities.llm_entities.LLMResultChunkWithStructuredOutput.__init__` [bad-argument-type]
1042c1036
<   --> core/plugin/backwards_invocation/model.py:66:100
---
>   --> core/plugin/backwards_invocation/model.py:67:87
1044,1045c1038,1039
< 66 |                         deduct_llm_quota(tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage)
<    |                                                                                                    ^^^^^^^^^^^
---
> 67 | ...                   tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage
>    |                                                                                 ^^^^^^^^^^^
1048c1042
<   --> core/plugin/backwards_invocation/model.py:67:21
---
>   --> core/plugin/backwards_invocation/model.py:69:21
1050c1044
< 67 |                     chunk.prompt_messages = []
---
> 69 |                     chunk.prompt_messages = []
1054c1048
<   --> core/plugin/backwards_invocation/model.py:68:27
---
>   --> core/plugin/backwards_invocation/model.py:70:27
1056c1050
< 68 |                     yield chunk
---
> 70 |                     yield chunk
1060c1054
<    --> core/plugin/backwards_invocation/model.py:122:33
---
>    --> core/plugin/backwards_invocation/model.py:124:33
1062c1056
< 122 |         if isinstance(response, Generator):
---
> 124 |         if isinstance(response, Generator):
1067c1061
<    --> core/plugin/backwards_invocation/model.py:126:24
---
>    --> core/plugin/backwards_invocation/model.py:128:24
1069c1063
< 126 |                     if chunk.delta.usage:
---
> 128 |                     if chunk.delta.usage:
1073c1067
<    --> core/plugin/backwards_invocation/model.py:127:100
---
>    --> core/plugin/backwards_invocation/model.py:130:87
1075,1076c1069,1070
< 127 |                         deduct_llm_quota(tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage)
<     |                                                                                                    ^^^^^^^^^^^
---
> 130 | ...                   tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage
>     |                                                                                 ^^^^^^^^^^^
1079c1073
<    --> core/plugin/backwards_invocation/model.py:128:21
---
>    --> core/plugin/backwards_invocation/model.py:132:21
1081c1075
< 128 |                     chunk.prompt_messages = []
---
> 132 |                     chunk.prompt_messages = []
1085c1079
<    --> core/plugin/backwards_invocation/model.py:129:27
---
>    --> core/plugin/backwards_invocation/model.py:133:27
1087c1081
< 129 |                     yield chunk
---
> 133 |                     yield chunk
1090,1091c1084,1085
< ERROR Argument `Mapping[str, Any] | None` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `dify_graph.model_runtime.entities.llm_entities.LLMResultChunkWithStructuredOutput.__init__` [bad-argument-type]
<    --> core/plugin/backwards_invocation/model.py:143:39
---
> ERROR Argument `Mapping[str, Any] | None` is not assignable to parameter `structured_output` with type `Mapping[LaxStr, Any] | None` in function `core.model_runtime.entities.llm_entities.LLMResultChunkWithStructuredOutput.__init__` [bad-argument-type]
>    --> core/plugin/backwards_invocation/model.py:147:39
1093c1087
< 143 |                     structured_output=response.structured_output,
---
> 147 |                     structured_output=response.structured_output,
1107,2841c1101
< ERROR Class member `Jieba.add_texts` overrides parent class `BaseKeyword` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/keyword/jieba/jieba.py:46:9
<    |
< 46 |     def add_texts(self, texts: list[Document], **kwargs):
<    |         ^^^^^^^^^
<    |
<   `Jieba.add_texts` has type `(self: Jieba, texts: list[Document], **kwargs: Unknown) -> None`, which is not assignable to `(self: Jieba, texts: list[Document], **kwargs: Unknown) -> Never`, the type of `BaseKeyword.add_texts`
<   Signature mismatch:
<   expected: def add_texts(self: Jieba, texts: list[Document], **kwargs: Unknown) -> Never: ...
<                                                                                      ^^^^ return type
<   found:    def add_texts(self: Jieba, texts: list[Document], **kwargs: Unknown) -> None: ...
<                                                                                      ^^^ return type
< ERROR Class member `Jieba.delete_by_ids` overrides parent class `BaseKeyword` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/keyword/jieba/jieba.py:76:9
<    |
< 76 |     def delete_by_ids(self, ids: list[str]):
<    |         ^^^^^^^^^^^^^
<    |
<   `Jieba.delete_by_ids` has type `(self: Jieba, ids: list[str]) -> None`, which is not assignable to `(self: Jieba, ids: list[str]) -> Never`, the type of `BaseKeyword.delete_by_ids`
<   Signature mismatch:
<   expected: def delete_by_ids(self: Jieba, ids: list[str]) -> Never: ...
<                                                                ^^^^ return type
<   found:    def delete_by_ids(self: Jieba, ids: list[str]) -> None: ...
<                                                                ^^^ return type
< ERROR Class member `Jieba.delete` overrides parent class `BaseKeyword` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/keyword/jieba/jieba.py:120:9
<     |
< 120 |     def delete(self):
<     |         ^^^^^^
<     |
<   `Jieba.delete` has type `(self: Jieba) -> None`, which is not assignable to `(self: Jieba) -> Never`, the type of `BaseKeyword.delete`
<   Signature mismatch:
<   expected: def delete(self: Jieba) -> Never: ...
<                                         ^^^^ return type
<   found:    def delete(self: Jieba) -> None: ...
<                                         ^^^ return type
< ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
<    --> core/rag/datasource/keyword/jieba/jieba.py:137:36
<     |
< 137 |         keyword_data_source_type = dataset_keyword_table.data_source_type
<     |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Object of class `NoneType` has no attribute `keyword_table` [missing-attribute]
<    --> core/rag/datasource/keyword/jieba/jieba.py:139:13
<     |
< 139 |             dataset_keyword_table.keyword_table = dumps_with_sets(keyword_table_dict)
<     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Cannot index into `set[Any]` [bad-index]
<    --> core/rag/datasource/keyword/jieba/jieba.py:152:29
<     |
< 152 |                 return dict(keyword_table_dict["__data__"]["table"])
<     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   Object of class `set` has no attribute `__getitem__`
< ERROR No matching overload found for function `list.__init__` called with arguments: (object) [no-matching-overload]
<   --> core/rag/datasource/keyword/jieba/jieba_keyword_table_handler.py:88:34
<    |
< 88 |                     tokens = list(cut(sentence))
<    |                                  ^^^^^^^^^^^^^^^
<    |
<   Possible overloads:
<   () -> None
<   (iterable: Iterable[_T], /) -> None [closest match]
< ERROR Class member `AnalyticdbVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/vdb/analyticdb/analyticdb_vector.py:43:9
<    |
< 43 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<    |         ^^^^^^^^^
<    |
<   `AnalyticdbVector.add_texts` has type `(self: AnalyticdbVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: AnalyticdbVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.CreateNamespaceRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:111:40
<     |
< 111 |                     namespace_password=self.config.namespace_password,
<     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.DescribeCollectionRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:132:40
<     |
< 132 |                     namespace_password=self.config.namespace_password,
<     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.UpsertCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:178:32
<     |
< 178 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:191:32
<     |
< 191 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `vector` with type `list[float]` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:195:20
<     |
< 195 |             vector=None,
<     |                    ^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `content` with type `str` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:196:21
<     |
< 196 |             content=None,
<     |                     ^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.DeleteCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:212:32
<     |
< 212 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `collection_data` with type `str` in function `alibabacloud_gpdb20160503.models.DeleteCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:214:29
<     |
< 214 |             collection_data=None,
<     |                             ^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.DeleteCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:226:32
<     |
< 226 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `collection_data` with type `str` in function `alibabacloud_gpdb20160503.models.DeleteCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:228:29
<     |
< 228 |             collection_data=None,
<     |                             ^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:247:32
<     |
< 247 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `content` with type `str` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:252:21
<     |
< 252 |             content=None,
<     |                     ^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:260:39
<     |
< 260 |                 metadata = json.loads(match.metadata.get("metadata_"))
<     |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `page_content` with type `bytearray | bytes | str` in function `core.rag.models.document.Document.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:263:34
<     |
< 263 |                     page_content=match.metadata.get("page_content"),
<     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:284:32
<     |
< 284 |             namespace_password=self.config.namespace_password,
<     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `None` is not assignable to parameter `vector` with type `list[float]` in function `alibabacloud_gpdb20160503.models.QueryCollectionDataRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:288:20
<     |
< 288 |             vector=None,
<     |                    ^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:297:39
<     |
< 297 |                 metadata = json.loads(match.metadata.get("metadata_"))
<     |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `page_content` with type `bytearray | bytes | str` in function `core.rag.models.document.Document.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:300:34
<     |
< 300 |                     page_content=match.metadata.get("page_content"),
<     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models.DeleteCollectionRequest.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:316:36
<     |
< 316 |                 namespace_password=self.config.namespace_password,
<     |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Class member `BaiduVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/vdb/baidu/baidu_vector.py:90:9
<    |
< 90 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<    |         ^^^^^^^^^
<    |
<   `BaiduVector.add_texts` has type `(self: BaiduVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: BaiduVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Object of class `FilteringIndex` has no attribute `state`
< Object of class `InvertedIndex` has no attribute `state`
< Object of class `SecondaryIndex` has no attribute `state` [missing-attribute]
<    --> core/rag/datasource/vdb/baidu/baidu_vector.py:117:16
<     |
< 117 |             if index.state == IndexState.NORMAL:
<     |                ^^^^^^^^^^^
<     |
< ERROR Expected a callable, got `None` [not-callable]
<    --> core/rag/datasource/vdb/baidu/baidu_vector.py:152:15
<     |
< 152 |         res = self._db.table(self._collection_name).search(
<     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `json` is uninitialized [unbound-name]
<    --> core/rag/datasource/vdb/baidu/baidu_vector.py:190:25
<     |
< 190 |                 except (json.JSONDecodeError, TypeError):
<     |                         ^^^^
<     |
< ERROR Argument `list[Field]` is not assignable to parameter `fields` with type `list[dict[str, str]] | list[str]` in function `pymochow.model.schema.FilteringIndex.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/baidu/baidu_vector.py:297:28
<     |
< 297 |                     fields=[VDBField.METADATA_KEY],
<     |                            ^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Class member `ChromaVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/vdb/chroma/chroma_vector.py:68:9
<    |
< 68 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<    |         ^^^^^^^^^
<    |
<   `ChromaVector.add_texts` has type `(self: ChromaVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: ChromaVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Class member `ClickzettaVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/clickzetta/clickzetta_vector.py:608:9
<     |
< 608 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<     |         ^^^^^^^^^
<     |
<   `ClickzettaVector.add_texts` has type `(self: ClickzettaVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: ClickzettaVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Type `None` is not iterable [not-iterable]
<    --> core/rag/datasource/vdb/couchbase/couchbase_vector.py:193:22
<     |
< 193 |         for scope in self._bucket.collections().get_all_scopes():
<     |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Expected 0 positional arguments, got 1 in function `couchbase.logic.search_queries.SearchQuery.__init__` [bad-argument-count]
<    --> core/rag/datasource/vdb/couchbase/couchbase_vector.py:309:77
<     |
< 309 |             CBrequest = search.SearchRequest.create(search.QueryStringQuery("text:" + query))
<     |                                                                             ^^^^^^^^^^^^^^^
<     |
< ERROR Type `None` is not iterable [not-iterable]
<    --> core/rag/datasource/vdb/couchbase/couchbase_vector.py:332:22
<     |
< 332 |         for scope in scopes:
<     |                      ^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `host` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `username` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `password` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `cloud_url` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `api_key` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `use_cloud` with type `Decimal | bool | float | int | str` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `ca_certs` with type `bytearray | bytes | str | None` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `verify_certs` with type `Decimal | bool | float | int | str` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `request_timeout` with type `Decimal | bool | bytes | float | int | str` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `retry_on_timeout` with type `Decimal | bool | float | int | str` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR Unpacked keyword argument `bool | Unknown | None` is not assignable to parameter `max_retries` with type `Decimal | bool | bytes | float | int | str` in function `ElasticSearchConfig.__init__` [bad-argument-type]
<    --> core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py:355:40
<     |
< 355 |             config=ElasticSearchConfig(**config_dict),
<     |                                        ^^^^^^^^^^^^^
<     |
< ERROR `tuple[str, str]` is not assignable to TypedDict key `basic_auth` with type `bool | int | list[str]` [bad-typed-dict-key]
<   --> core/rag/datasource/vdb/huawei/huawei_cloud_vector.py:51:36
<    |
< 51 |             params["basic_auth"] = (self.username, self.password)
<    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<    |
< ERROR Class member `LindormVectorStore.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:84:9
<    |
< 84 |     def add_texts(
<    |         ^^^^^^^^^
<    |
<   `LindormVectorStore.add_texts` has type `(self: LindormVectorStore, documents: list[Document], embeddings: list[list[float]], batch_size: int = 64, timeout: int = 60, **kwargs: Unknown) -> None`, which is not assignable to `(self: LindormVectorStore, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ...ings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                               ^ parameters          ^^^^^^^^^ return type
<   ...ings: list[list[float]], batch_size: int = 64, timeout: int = 60, **kwargs: Unknown) -> None: ...
<                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters           ^^^^ return type
< ERROR `str | None` is not assignable to TypedDict key `routing` with type `str` [bad-typed-dict-key]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:133:57
<     |
< 133 |                     action_header["index"]["routing"] = self._routing
<     |                                                         ^^^^^^^^^^^^^
<     |
< ERROR Class member `LindormVectorStore.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:150:9
<     |
< 150 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `LindormVectorStore.get_ids_by_metadata_field` has type `(self: LindormVectorStore, key: str, value: str) -> list[Unknown] | None`, which is not assignable to `(self: LindormVectorStore, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: LindormVectorStore, key: str, value: str) -> Never: ...
<                                                                                              ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: LindormVectorStore, key: str, value: str) -> list[Unknown] | None: ...
<                                                                                              ^^^^^^^^^^^^^^^^^^^^ return type
< ERROR Object of class `NoneType` has no attribute `get` [missing-attribute]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:383:35
<     |
< 383 |             stored_in_ugc: bool = dataset.index_struct_dict.get("using_ugc", False)
<     |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:386:29
<     |
< 386 |                 dimension = dataset.index_struct_dict["dimension"]
<     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:387:30
<     |
< 387 |                 index_type = dataset.index_struct_dict["index_type"]
<     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:388:33
<     |
< 388 |                 distance_type = dataset.index_struct_dict["distance_type"]
<     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:389:33
<     |
< 389 |                 routing_value = dataset.index_struct_dict["vector_store"]["class_prefix"]
<     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/lindorm/lindorm_vector.py:392:30
<     |
< 392 |                 index_name = dataset.index_struct_dict["vector_store"]["class_prefix"].lower()
<     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Class member `MatrixoneVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/matrixone/matrixone_vector.py:144:9
<     |
< 144 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `MatrixoneVector.get_ids_by_metadata_field` has type `(MatrixoneVector, key: str, value: str) -> list[Unknown]`, which is not assignable to `(self: MatrixoneVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: MatrixoneVector, key: str, value: str) -> Never: ...
<                                           ^^^^^^ parameters                               ^^^^^ return type
<   found:    def get_ids_by_metadata_field(MatrixoneVector, key: str, value: str) -> list[Unknown]: ...
<                                           ^ parameters                              ^^^^^^^^^^^^^ return type
< ERROR Class member `MilvusVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/milvus/milvus_vector.py:153:9
<     |
< 153 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `MilvusVector.get_ids_by_metadata_field` has type `(self: MilvusVector, key: str, value: str) -> list[Unknown] | None`, which is not assignable to `(self: MilvusVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: MilvusVector, key: str, value: str) -> Never: ...
<                                                                                        ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: MilvusVector, key: str, value: str) -> list[Unknown] | None: ...
<                                                                                        ^^^^^^^^^^^^^^^^^^^^ return type
< ERROR Expected argument after ** to be a mapping, got: dict[Unknown, Unknown] | None in function `pymilvus.milvus_client.index.IndexParams.add_index` [bad-unpacking]
<    --> core/rag/datasource/vdb/milvus/milvus_vector.py:355:71
<     |
< 355 |                 index_params_obj.add_index(field_name=Field.VECTOR, **index_params)
<     |                                                                       ^^^^^^^^^^^^
<     |
< ERROR Class member `MyScaleVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/myscale/myscale_vector.py:111:9
<     |
< 111 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `MyScaleVector.get_ids_by_metadata_field` has type `(self: MyScaleVector, key: str, value: str) -> list[Any]`, which is not assignable to `(self: MyScaleVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: MyScaleVector, key: str, value: str) -> Never: ...
<                                                                                         ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: MyScaleVector, key: str, value: str) -> list[Any]: ...
<                                                                                         ^^^^^^^^^ return type
< ERROR Argument `Literal['HNSW']` is not assignable to parameter `index_type` with type `VecIndexType` in function `pyobvector.client.index_param.IndexParams.add_index` [bad-argument-type]
<    --> core/rag/datasource/vdb/oceanbase/oceanbase_vector.py:159:28
<     |
< 159 |                 index_type=OCEANBASE_SUPPORTED_VECTOR_INDEX_TYPE,
<     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/oceanbase/oceanbase_vector.py:231:31
<     |
< 231 |             ob_full_version = result.fetchone()[0]
<     |                               ^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Class member `OceanBaseVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/oceanbase/oceanbase_vector.py:239:9
<     |
< 239 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<     |         ^^^^^^^^^
<     |
<   `OceanBaseVector.add_texts` has type `(self: OceanBaseVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: OceanBaseVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Class member `OceanBaseVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/oceanbase/oceanbase_vector.py:311:9
<     |
< 311 |     def get_ids_by_metadata_field(self, key: str, value: str) -> list[str]:
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `OceanBaseVector.get_ids_by_metadata_field` has type `(self: OceanBaseVector, key: str, value: str) -> list[str]`, which is not assignable to `(self: OceanBaseVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: OceanBaseVector, key: str, value: str) -> Never: ...
<                                                                                           ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: OceanBaseVector, key: str, value: str) -> list[str]: ...
<                                                                                           ^^^^^^^^^ return type
< ERROR Argument `Sequence[Row[Any]]` is not assignable to parameter `results` with type `list[tuple[Unknown, ...]]` in function `OceanBaseVector._process_search_results` [bad-argument-type]
<    --> core/rag/datasource/vdb/oceanbase/oceanbase_vector.py:431:57
<     |
< 431 |                     return self._process_search_results(rows, score_threshold=score_threshold)
<     |                                                         ^^^^
<     |
< ERROR `tuple[Never, Never]` is not assignable to TypedDict key `http_auth` with type `type[Urllib3HttpConnection] | bool | int | list[dict[str, int | str]]` [bad-typed-dict-key]
<   --> core/rag/datasource/vdb/opensearch/opensearch_vector.py:72:35
<    |
< 72 |             params["http_auth"] = (self.user, self.password)
<    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
<    |
< ERROR Class member `OpenSearchVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<   --> core/rag/datasource/vdb/opensearch/opensearch_vector.py:95:9
<    |
< 95 |     def add_texts(self, documents: list[Document], embeddings: list[list[float]], **kwargs):
<    |         ^^^^^^^^^
<    |
<   `OpenSearchVector.add_texts` has type `(self: OpenSearchVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> None`, which is not assignable to `(self: OpenSearchVector, documents: list[Document], embeddings: list[list[float]], **kwargs: Unknown) -> list[str]`, the type of `BaseVector.add_texts`
<   Signature mismatch:
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> list[str]: ...
<                                                            ^^^^^^^^^ return type
<   ... embeddings: list[list[float]], **kwargs: Unknown) -> None: ...
<                                                            ^^^^ return type
< ERROR Class member `OpenSearchVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/opensearch/opensearch_vector.py:119:9
<     |
< 119 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `OpenSearchVector.get_ids_by_metadata_field` has type `(self: OpenSearchVector, key: str, value: str) -> list[Unknown] | None`, which is not assignable to `(self: OpenSearchVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: OpenSearchVector, key: str, value: str) -> Never: ...
<                                                                                            ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: OpenSearchVector, key: str, value: str) -> list[Unknown] | None: ...
<                                                                                            ^^^^^^^^^^^^^^^^^^^^ return type
< ERROR `dict[str, dict[Field | str, list[float] | Any]]` is not assignable to TypedDict key with type `dict[Field, dict[Field | str, list[float] | Any]]` [bad-typed-dict-key]
<    --> core/rag/datasource/vdb/opensearch/opensearch_vector.py:189:33
<     |
< 189 |                   "script_score": {
<     |  _________________________________^
< 190 | |                     "query": {"bool": {"filter": [{"terms": {Field.DOCUMENT_ID: document_ids_filter}}]}},
< 191 | |                     "script": {
< 192 | |                         "source": "knn_score",
< 193 | |                         "lang": "knn",
< 194 | |                         "params": {"field": Field.VECTOR, "query_value": query_vector, "space_type": "l2"},
<     | |____________________________________________________________________________________________________________^
<     |
< ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, str | None]) [no-matching-overload]
<    --> core/rag/datasource/vdb/oracle/oraclevector.py:139:31
<     |
< 139 |               pool_params.update(
<     |  _______________________________^
< 140 | |                 {
< 141 | |                     "config_dir": config.config_dir,
< 142 | |                     "wallet_location": config.wallet_location,
< 143 | |                     "wallet_password": config.wallet_password,
< 144 | |                 }
<     | |__________________^
<     |
<   Possible overloads:
<   (m: SupportsKeysAndGetItem[str, int | str], /) -> None [closest match]
<   (m: SupportsKeysAndGetItem[str, int | str], /, **kwargs: int | str) -> None
<   (m: Iterable[tuple[str, int | str]], /) -> None
<   (m: Iterable[tuple[str, int | str]], /, **kwargs: int | str) -> None
<   (**kwargs: int | str) -> None
< ERROR Function declared to return `bool`, but one or more paths are missing an explicit `return` [bad-return]
<    --> core/rag/datasource/vdb/oracle/oraclevector.py:191:39
<     |
< 191 |     def text_exists(self, id: str) -> bool:
<     |                                       ^^^^
<     |
< ERROR Class member `PGVectoRS.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/pgvecto_rs/pgvecto_rs.py:135:9
<     |
< 135 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `PGVectoRS.get_ids_by_metadata_field` has type `(self: PGVectoRS, key: str, value: str) -> list[Any] | None`, which is not assignable to `(self: PGVectoRS, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: PGVectoRS, key: str, value: str) -> Never: ...
<                                                                                     ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: PGVectoRS, key: str, value: str) -> list[Any] | None: ...
<                                                                                     ^^^^^^^^^^^^^^^^ return type
< ERROR Class member `RelytVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/relyt/relyt_vector.py:154:9
<     |
< 154 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `RelytVector.get_ids_by_metadata_field` has type `(self: RelytVector, key: str, value: str) -> list[Any] | None`, which is not assignable to `(self: RelytVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: RelytVector, key: str, value: str) -> Never: ...
<                                                                                       ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: RelytVector, key: str, value: str) -> list[Any] | None: ...
<                                                                                       ^^^^^^^^^^^^^^^^ return type
< ERROR Cannot unpack list[Unknown] | tuple[CapacityUnit | None, Row | None] | tuple[CapacityUnit | None, Row | None, Unknown] | tuple[CapacityUnit | None, list[Unknown] | Unknown | None, list[Unknown], Unknown] | tuple[SearchIndexMeta, SyncStat | None] | tuple[list[Unknown], list[Unknown], list[Unknown]] | tuple[Unknown, ...] | tuple[*tuple[Unknown, ...]] (of size 2) into 3 values [bad-unpacking]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:107:9
<     |
< 107 |         _, return_row, _ = result
<     |         ^^^^^^^^^^^^^^^^
<     |
< ERROR Cannot unpack list[Unknown] | tuple[CapacityUnit | None, Row | None] | tuple[CapacityUnit | None, Row | None, Unknown] | tuple[CapacityUnit | None, list[Unknown] | Unknown | None, list[Unknown], Unknown] | tuple[SearchIndexMeta, SyncStat | None] | tuple[list[Unknown], list[Unknown], list[Unknown]] | tuple[Unknown, ...] | tuple[*tuple[Unknown, ...]] (of size 4) into 3 values [bad-unpacking]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:107:9
<     |
< 107 |         _, return_row, _ = result
<     |         ^^^^^^^^^^^^^^^^
<     |
< ERROR Class member `TableStoreVector.get_ids_by_metadata_field` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:117:9
<     |
< 117 |     def get_ids_by_metadata_field(self, key: str, value: str):
<     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
<   `TableStoreVector.get_ids_by_metadata_field` has type `(self: TableStoreVector, key: str, value: str) -> list[str]`, which is not assignable to `(self: TableStoreVector, key: str, value: str) -> Never`, the type of `BaseVector.get_ids_by_metadata_field`
<   Signature mismatch:
<   expected: def get_ids_by_metadata_field(self: TableStoreVector, key: str, value: str) -> Never: ...
<                                                                                            ^^^^^ return type
<   found:    def get_ids_by_metadata_field(self: TableStoreVector, key: str, value: str) -> list[str]: ...
<                                                                                            ^^^^^^^^^ return type
< ERROR `in` is not supported between `str` and `DeleteTimeseriesMetaResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `DescribeTableResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `DescribeTimeseriesTableResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `GetTimeseriesDataResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `PutTimeseriesDataResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `QueryTimeseriesMetaResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `UpdateTableResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `UpdateTimeseriesMetaResponse` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR `in` is not supported between `str` and `None` [not-iterable]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:159:12
<     |
< 159 |         if self._table_name in table_list:
<     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Cannot index into `CapacityUnit` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:173:33
<     |
< 173 |         if self._index_name in [t[1] for t in search_index_list]:
<     |                                 ^^^^
<     |
<   Object of class `CapacityUnit` has no attribute `__getitem__`
< ERROR Cannot index into `Row` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:173:33
<     |
< 173 |         if self._index_name in [t[1] for t in search_index_list]:
<     |                                 ^^^^
<     |
<   Object of class `Row` has no attribute `__getitem__`
< ERROR Cannot index into `SearchIndexMeta` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:173:33
<     |
< 173 |         if self._index_name in [t[1] for t in search_index_list]:
<     |                                 ^^^^
<     |
<   Object of class `SearchIndexMeta` has no attribute `__getitem__`
< ERROR Cannot index into `SyncStat` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:173:33
<     |
< 173 |         if self._index_name in [t[1] for t in search_index_list]:
<     |                                 ^^^^
<     |
<   Object of class `SyncStat` has no attribute `__getitem__`
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:173:33
<     |
< 173 |         if self._index_name in [t[1] for t in search_index_list]:
<     |                                 ^^^^
<     |
< ERROR Cannot index into `CapacityUnit` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:57
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                         ^^^^^^^^^^^^^
<     |
<   Object of class `CapacityUnit` has no attribute `__getitem__`
< ERROR Cannot index into `Row` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:57
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                         ^^^^^^^^^^^^^
<     |
<   Object of class `Row` has no attribute `__getitem__`
< ERROR Cannot index into `SearchIndexMeta` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:57
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                         ^^^^^^^^^^^^^
<     |
<   Object of class `SearchIndexMeta` has no attribute `__getitem__`
< ERROR Cannot index into `SyncStat` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:57
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                         ^^^^^^^^^^^^^
<     |
<   Object of class `SyncStat` has no attribute `__getitem__`
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:57
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                         ^^^^^^^^^^^^^
<     |
< ERROR Cannot index into `CapacityUnit` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:72
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                                        ^^^^^^^^^^^^^
<     |
<   Object of class `CapacityUnit` has no attribute `__getitem__`
< ERROR Cannot index into `Row` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:72
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                                        ^^^^^^^^^^^^^
<     |
<   Object of class `Row` has no attribute `__getitem__`
< ERROR Cannot index into `SearchIndexMeta` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:72
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                                        ^^^^^^^^^^^^^
<     |
<   Object of class `SearchIndexMeta` has no attribute `__getitem__`
< ERROR Cannot index into `SyncStat` [bad-index]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:72
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                                        ^^^^^^^^^^^^^
<     |
<   Object of class `SyncStat` has no attribute `__getitem__`
< ERROR `None` is not subscriptable [unsupported-operation]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:218:72
<     |
< 218 |             self._tablestore_client.delete_search_index(resp_tuple[0], resp_tuple[1])
<     |                                                                        ^^^^^^^^^^^^^
<     |
< ERROR Pyrefly detected conflicting types while breaking a dependency cycle: `object | Unknown | None` is not assignable to `None`. Adding explicit type annotations might possibly help. [bad-assignment]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:260:9
<     |
< 260 | /         while True:
< 261 | |             if next_token is not None:
< 262 | |                 query.next_token = next_token
< 263 | |
< 264 | |             search_response = self._tablestore_client.search(
< 265 | |                 table_name=self._table_name,
<     | |_____________________________________________^
<     |
< ERROR Object of class `ComputeSplitsResponse` has no attribute `rows`
< Object of class `DeleteTimeseriesMetaResponse` has no attribute `rows`
< Object of class `DescribeTableResponse` has no attribute `rows`
< Object of class `DescribeTimeseriesTableResponse` has no attribute `rows`
< Object of class `PutTimeseriesDataResponse` has no attribute `rows`
< Object of class `QueryTimeseriesMetaResponse` has no attribute `rows`
< Object of class `UpdateTableResponse` has no attribute `rows`
< Object of class `UpdateTimeseriesMetaResponse` has no attribute `rows`
< Object of class `dict` has no attribute `rows`
< Object of class `list` has no attribute `rows`
< Object of class `tuple` has no attribute `rows` [missing-attribute]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:274:59
<     |
< 274 |                 rows.extend([row[0][0][1] for row in list(search_response.rows)])
<     |                                                           ^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Object of class `ComputeSplitsResponse` has no attribute `next_token`
< Object of class `DeleteTimeseriesMetaResponse` has no attribute `next_token`
< Object of class `DescribeTableResponse` has no attribute `next_token`
< Object of class `DescribeTimeseriesTableResponse` has no attribute `next_token`
< Object of class `GetTimeseriesDataResponse` has no attribute `next_token`
< Object of class `PutTimeseriesDataResponse` has no attribute `next_token`
< Object of class `QueryTimeseriesMetaResponse` has no attribute `next_token`
< Object of class `UpdateTableResponse` has no attribute `next_token`
< Object of class `UpdateTimeseriesMetaResponse` has no attribute `next_token`
< Object of class `dict` has no attribute `next_token`
< Object of class `list` has no attribute `next_token`
< Object of class `tuple` has no attribute `next_token` [missing-attribute]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:276:43
<     |
< 276 |             if search_response is None or search_response.next_token == b"":
<     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Object of class `ComputeSplitsResponse` has no attribute `search_hits`
< Object of class `DeleteTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `DescribeTableResponse` has no attribute `search_hits`
< Object of class `DescribeTimeseriesTableResponse` has no attribute `search_hits`
< Object of class `GetTimeseriesDataResponse` has no attribute `search_hits`
< Object of class `NoneType` has no attribute `search_hits`
< Object of class `ParallelScanResponse` has no attribute `search_hits`
< Object of class `PutTimeseriesDataResponse` has no attribute `search_hits`
< Object of class `QueryTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `UpdateTableResponse` has no attribute `search_hits`
< Object of class `UpdateTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `dict` has no attribute `search_hits`
< Object of class `list` has no attribute `search_hits`
< Object of class `tuple` has no attribute `search_hits` [missing-attribute]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:304:27
<     |
< 304 |         for search_hit in search_response.search_hits:
<     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Object of class `ComputeSplitsResponse` has no attribute `search_hits`
< Object of class `DeleteTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `DescribeTableResponse` has no attribute `search_hits`
< Object of class `DescribeTimeseriesTableResponse` has no attribute `search_hits`
< Object of class `GetTimeseriesDataResponse` has no attribute `search_hits`
< Object of class `NoneType` has no attribute `search_hits`
< Object of class `ParallelScanResponse` has no attribute `search_hits`
< Object of class `PutTimeseriesDataResponse` has no attribute `search_hits`
< Object of class `QueryTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `UpdateTableResponse` has no attribute `search_hits`
< Object of class `UpdateTimeseriesMetaResponse` has no attribute `search_hits`
< Object of class `dict` has no attribute `search_hits`
< Object of class `list` has no attribute `search_hits`
< Object of class `tuple` has no attribute `search_hits` [missing-attribute]
<    --> core/rag/datasource/vdb/tablestore/tablestore_vector.py:360:27
<     |
< 360 |         for search_hit in search_response.search_hits:
<     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
<     |
< ERROR Argument `str | None` is not \n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-03 14:17:04.508142903 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-03 14:16:56.198147867 +0000
@@ -711,10 +711,16 @@
    --> core/rag/index_processor/processor/qa_index_processor.py:203:33
 ERROR Object of class `Document` has no attribute `score` [missing-attribute]
    --> core/rag/index_processor/processor/qa_index_processor.py:204:16
+ERROR Argument `dict[str, Any] | None` is not assignable to parameter `external_retrieval_parameters` with type `dict[Unknown, Unknown]` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+   --> core/rag/retrieval/dataset_retrieval.py:642:55
+ERROR Argument `dict[str, Any] | None` is not assignable to parameter `external_retrieval_parameters` with type `dict[Unknown, Unknown]` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+    --> core/rag/retrieval/dataset_retrieval.py:1042:51
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[SystemPromptMessage | UserPromptMessage], tools=list[PromptMessageTool], stream=Literal[False], model_parameters=dict[str, float | int]) [no-matching-overload]
   --> core/rag/retrieval/router/multi_dataset_function_call_router.py:31:58
 ERROR Argument `Dataset | None` is not assignable to parameter `dataset` with type `Dataset` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
   --> core/rag/summary_index/summary_index.py:74:85
+ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
+  --> core/rag/summary_index/summary_index.py:74:94
 ERROR Argument `Mapping[str, Any]` is not assignable to parameter `graph` with type `Mapping[LaxStr, Any]` in function `dify_graph.entities.workflow_execution.WorkflowExecution.__init__` [bad-argument-type]
    --> core/repositories/sqlalchemy_workflow_execution_repository.py:109:19
 ERROR Argument `Mapping[str, Any]` is not assignable to parameter `inputs` with type `Mapping[LaxStr, Any]` in function `dify_graph.entities.workflow_execution.WorkflowExecution.__init__` [bad-argument-type]
@@ -733,6 +739,8 @@
   --> core/tools/mcp_tool/provider.py:82:31
 ERROR Class member `PluginToolProviderController.entity` overrides parent class `BuiltinToolProviderController` in an inconsistent manner [bad-override]
   --> core/tools/plugin_tool/provider.py:12:5
+ERROR Argument `dict[str, Any] | None` is not assignable to parameter `external_retrieval_parameters` with type `dict[Unknown, Unknown]` in function `services.external_knowledge_service.ExternalDatasetService.fetch_external_knowledge_retrieval` [bad-argument-type]
+  --> core/tools/utils/dataset_retriever/dataset_retriever_tool.py:88:47
 ERROR `dict[Unknown, Unknown] | float | list[Unknown] | str | Unknown` is not assignable to attribute `json_object` with type `dict[Unknown, Unknown] | list[Unknown]` [bad-assignment]
    --> core/tools/utils/message_transformer.py:163:51
 ERROR `(method: str, url: str, max_retries: int = ..., **kwargs: Any) -> httpx._models.Response` is not assignable to attribute `perform_request` with type `(self: CloudScraper, method: Unknown, url: Unknown, *args: Unknown, **kwargs: Unknown) -> requests.models.Response` [bad-assignment]
@@ -1197,6 +1205,12 @@
   --> services/auth/watercrawl/watercrawl.py:21:9
 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 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/dataset_service.py:250:31
+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/dataset_service.py:254:44
+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/dataset_service.py:255:35
 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:2073: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]
@@ -1299,6 +1313,8 @@
    --> tasks/app_generate/workflow_execute_task.py:429:37
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[Mapping[str, Any] | str, None, None] | Mapping[str, Any]` [unsafe-overlap]
    --> tasks/app_generate/workflow_execute_task.py:483:37
+ERROR Argument `dict[str, Any] | None` is not assignable to parameter `summary_index_setting` with type `dict[Unknown, Unknown]` in function `services.summary_index_service.SummaryIndexService.generate_and_vectorize_summary` [bad-argument-type]
+   --> tasks/regenerate_summary_index_task.py:262:55
 ERROR `Literal['error']` is not assignable to attribute `status` with type `Never` [bad-assignment]
    --> tasks/regenerate_summary_index_task.py:277:61
 ERROR `str` is not assignable to attribute `error` with type `Never` [bad-assignment]
@@ -1767,6 +1783,10 @@
     --> tests/test_containers_integration_tests/services/test_app_service.py:1120:68
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
     --> tests/test_containers_integration_tests/services/test_app_service.py:1128:68
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> tests/test_containers_integration_tests/services/test_dataset_service.py:387:16
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> tests/test_containers_integration_tests/services/test_dataset_service.py:388:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_message_service.py:116:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2007,36 +2027,20 @@
    --> tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py:320:16
 ERROR `>` is not supported between `None` and `Literal[0]` [unsupported-operation]
    --> tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py:720:16
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:287:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:290:22
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:399:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:402:22
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:467:36
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:470:26
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:522:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:525:22
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:607:36
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:610:26
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:722:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:725:22
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:808:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:811:22
-ERROR Argument `str | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:963:32
 ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
    --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:966:22
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 7, 2026
@asukaminato0721 asukaminato0721 requested a review from Copilot April 7, 2026 07:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-07 07:19:35.873684542 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-07 07:19:26.867690695 +0000
@@ -321,6 +321,8 @@
    --> services/audio_service.py:151:52
 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 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/dataset_service.py:273:31
 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:2117: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]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR incrementally improves SQLAlchemy 2.0 ORM typing for the Dataset model by adding Mapped[...] annotations to previously untyped columns, aligning the model with the repo’s broader typed-ORM direction discussed in #22652.

Changes:

  • Added Mapped[...] type annotations to Dataset.description, Dataset.updated_by, and Dataset.updated_at column attributes.
  • Standardized these attributes to use SQLAlchemy 2.0 typed declarative style for improved static type checking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/models/dataset.py
tenant_id: Mapped[str] = mapped_column(StringUUID)
name: Mapped[str] = mapped_column(String(255))
description = mapped_column(LongText, nullable=True)
description: Mapped[str] = mapped_column(LongText, nullable=True)
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is declared as Mapped[str] but the column is nullable=True, so the ORM attribute can be None. This should be typed as Mapped[str | None] (and typically default=None) to match the DB nullability and existing model patterns (e.g., Account.avatar).

Suggested change
description: Mapped[str] = mapped_column(LongText, nullable=True)
description: Mapped[str | None] = mapped_column(LongText, nullable=True, default=None)

Copilot uses AI. Check for mistakes.
Comment thread api/models/dataset.py
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, server_default=func.current_timestamp())
updated_by = mapped_column(StringUUID, nullable=True)
updated_at = mapped_column(
updated_by: Mapped[str] = mapped_column(StringUUID, nullable=True)
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated_by is annotated as Mapped[str] but the column is nullable=True, so it should allow None (i.e., Mapped[str | None], typically with default=None). As-is, the typing is unsound and will cause incorrect assumptions in type checking.

Suggested change
updated_by: Mapped[str] = mapped_column(StringUUID, nullable=True)
updated_by: Mapped[str | None] = mapped_column(StringUUID, nullable=True, default=None)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants