refactor: add missing @override decorators to method overrides#36501
Open
EvanYao826 wants to merge 3 commits into
Open
refactor: add missing @override decorators to method overrides#36501EvanYao826 wants to merge 3 commits into
EvanYao826 wants to merge 3 commits into
Conversation
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
Contributor
Pyrefly Diffbase → 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]
|
Contributor
Pyrefly Type Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#36406
What
Added
@overridedecorator to 147 methods across 53 files that override parent class methods but were missing the decorator, as flagged by pyright'smissing-override-decoratorcheck.Changes
from typing import override(or appended to existing typing import) in each file@overridedecorator before each overriding method definitionPluginModelRuntime,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.