Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: add missing @override decorator to remaining MCP, Jieba, embeddings, and misc subclasses#36528

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
AlsoTheZv3n:refactor/add-override-mcp-jieba-misc
May 22, 2026
Merged

refactor: add missing @override decorator to remaining MCP, Jieba, embeddings, and misc subclasses#36528
asukaminato0721 merged 1 commit into
langgenius:mainfrom
AlsoTheZv3n:refactor/add-override-mcp-jieba-misc

Conversation

@AlsoTheZv3n
Copy link
Copy Markdown
Contributor

Relates to #36406.

Adds @override (PEP 698, from typing import override) to the remaining 26 subclass method overrides flagged by pyrefly's missing-override-decorator check, across 9 files:

MCP client and session:

  • MCPClientWithAuthRetry: __enter__, list_tools, invoke_tool (api/core/mcp/auth_client.py)
  • ClientSession: send_progress_notification, _received_request, _handle_incoming, _received_notification (api/core/mcp/session/client_session.py)

RAG keyword and vector backends:

  • Jieba (BaseKeyword subclass): create, add_texts, text_exists, delete_by_ids, search, delete (api/core/rag/datasource/keyword/jieba/jieba.py)
  • _LazyEmbeddings (Embeddings subclass): embed_documents, embed_multimodal_documents, embed_query, embed_multimodal_query, aembed_documents, aembed_query (api/core/rag/datasource/vdb/vector_factory.py)

External data tool:

  • ApiExternalDataTool: validate_config, query (api/core/external_data_tool/api/api.py)

Draft variable saver:

  • NoopDraftVariableSaver.save (api/core/app/apps/draft_variable_saver.py)

Service API workflow fields (flask_restx fields.Raw subclasses):

  • WorkflowRunStatusField.output, WorkflowRunOutputsField.output (api/controllers/service_api/app/workflow.py)

Plugin daemon exception:

  • PluginDaemonError.__str__ (api/core/plugin/impl/exc.py)

Provider configurations (pydantic BaseModel subclass):

  • ProviderConfigurations.__iter__ (api/core/entities/provider_configuration.py)

@override is placed below @property/@classmethod per the PEP 698 convention. Pattern follows the merged example in #36425 and all previous merged slices (#36486, #36490, #36491, #36492, #36493, #36494, #36495, #36496, #36511).

This closes out the remaining missing-override-decorator errors from the issue body that hadn't already been covered by previous slices, so #36406 should be fully resolved after this PR lands.

…beddings, and misc subclasses

Relates to langgenius#36406. Adds @OverRide (26 decorators across 9 files) to the
remaining subclass methods flagged by pyrefly's missing-override-decorator
check:

- MCPClientWithAuthRetry: __enter__, list_tools, invoke_tool
- ClientSession: send_progress_notification, _received_request,
  _handle_incoming, _received_notification
- Jieba (BaseKeyword): create, add_texts, text_exists, delete_by_ids,
  search, delete
- _LazyEmbeddings (Embeddings): embed_documents, embed_multimodal_documents,
  embed_query, embed_multimodal_query, aembed_documents, aembed_query
- ApiExternalDataTool: validate_config, query
- NoopDraftVariableSaver.save
- WorkflowRunStatusField.output, WorkflowRunOutputsField.output (flask_restx
  fields.Raw subclasses)
- PluginDaemonError.__str__ (Exception subclass)
- ProviderConfigurations.__iter__ (pydantic BaseModel subclass)

@OverRide is placed below @property/@classmethod per the established
pattern. Uses 'from typing import override' (Python 3.12+ stdlib) per
the pattern established in langgenius#36486.
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 44.90% 44.90% 0.00%
Strict coverage 44.42% 44.42% 0.00%
Typed symbols 23,118 23,118 0
Untyped symbols 28,674 28,674 0
Modules 2611 2611 0

@asukaminato0721 asukaminato0721 enabled auto-merge May 22, 2026 13:44
@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 22, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 22, 2026
@asukaminato0721
Copy link
Copy Markdown
Contributor

You can add the flag to true after this pr.

Merged via the queue into langgenius:main with commit 4d8b6c7 May 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants