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

Skip to content

refactor: add missing @override decorator to Moderation subclasses#36492

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
AlsoTheZv3n:refactor/add-override-moderation
May 21, 2026
Merged

refactor: add missing @override decorator to Moderation subclasses#36492
asukaminato0721 merged 1 commit into
langgenius:mainfrom
AlsoTheZv3n:refactor/add-override-moderation

Conversation

@AlsoTheZv3n
Copy link
Copy Markdown
Contributor

Relates to #36406.

Adds @override (PEP 698, from typing import override) to the three abstract methods (validate_config, moderation_for_inputs, moderation_for_outputs) in the three Moderation subclasses (9 decorators total):

  • ApiModeration (api/core/moderation/api/api.py)
  • KeywordsModeration (api/core/moderation/keywords/keywords.py)
  • OpenAIModeration (api/core/moderation/openai_moderation/openai_moderation.py)

Pattern follows the merged example in #36425 and the previous slices in #36486, #36490, #36491.

Relates to langgenius#36406. Adds @OverRide to validate_config, moderation_for_inputs,
and moderation_for_outputs in the three Moderation subclasses
(ApiModeration, KeywordsModeration, OpenAIModeration). Uses 'from typing
import override' (Python 3.12+ stdlib) per the pattern established in
langgenius#36486.
@AlsoTheZv3n AlsoTheZv3n requested a review from QuantumGhost as a code owner May 21, 2026 16:22
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. refactor labels May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 44.64% 44.64% 0.00%
Strict coverage 44.16% 44.16% 0.00%
Typed symbols 22,971 22,971 0
Untyped symbols 28,793 28,793 0
Modules 2611 2611 0

@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 21, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 21, 2026
Merged via the queue into langgenius:main with commit ee28074 May 21, 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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants