Skip to content

refactor: add missing @override decorators to method overrides#36501

Open
EvanYao826 wants to merge 3 commits into
langgenius:mainfrom
EvanYao826:refactor/add-missing-override-decorator
Open

refactor: add missing @override decorators to method overrides#36501
EvanYao826 wants to merge 3 commits into
langgenius:mainfrom
EvanYao826:refactor/add-missing-override-decorator

Conversation

@EvanYao826
Copy link
Copy Markdown
Contributor

@EvanYao826 EvanYao826 commented May 22, 2026

#36406

What

Added @override decorator to 147 methods across 53 files that override parent class methods but were missing the decorator, as flagged by pyright's missing-override-decorator check.

Changes

  • Added from typing import override (or appended to existing typing import) in each file
  • Added @override decorator before each overriding method definition
  • Covers all classes listed in the issue: PluginModelRuntime, DifyConfig, FlaskAppContext, DatabaseFileAccessController, persistence layers, response converters, moderation classes, code executors, MCP client, logging filters, datasource plugins, etc.

How

Systematic find-and-replace: identified each class/method pair from the issue, located the file containing the class, and added the decorator with proper indentation.

Added @OverRide decorator to methods that override parent class methods
but were missing the decorator, as flagged by pyright's
missing-override-decorator check.

Fixes langgenius#36406
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels May 22, 2026
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 22, 2026
@asukaminato0721 asukaminato0721 enabled auto-merge May 22, 2026 03:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-22 03:19:17.974992637 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-22 03:19:04.686910794 +0000
@@ -42,6 +42,14 @@
    --> core/llm_generator/llm_generator.py:653:60
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-override-param-name]
    --> core/ops/ops_trace_manager.py:218:9
+ERROR `@override` should only be applied to the implementation of an overloaded function. [invalid-overload]
+   --> core/plugin/impl/model_runtime.py:276:9
+ERROR `@override` should only be applied to the implementation of an overloaded function. [invalid-overload]
+   --> core/plugin/impl/model_runtime.py:291:9
+ERROR `@override` should only be applied to the implementation of an overloaded function. [invalid-overload]
+   --> core/plugin/impl/model_runtime.py:342:9
+ERROR `@override` should only be applied to the implementation of an overloaded function. [invalid-overload]
+   --> core/plugin/impl/model_runtime.py:357:9
 ERROR `list[dict[str, str | dict[str, str]]] | list[Unknown]` is not assignable to TypedDict key `tool_calls` with type `list[dict[str, str]] | str` [bad-typed-dict-key]
   --> core/prompt/utils/prompt_message_util.py:83:44
 ERROR Argument `Unknown | None` is not assignable to parameter `result_object` with type `dict[str, Any]` in function `WaterCrawlProvider._structure_data` [bad-argument-type]

@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,110 23,110 0
Untyped symbols 28,667 28,667 0
Modules 2611 2611 0

@asukaminato0721 asukaminato0721 disabled auto-merge May 22, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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