Skip to content

feat: RuleDictConsistency#387

Merged
shijinpjlab merged 1 commit intoMigoXLab:devfrom
shijinpjlab:dev_0409
Apr 10, 2026
Merged

feat: RuleDictConsistency#387
shijinpjlab merged 1 commit intoMigoXLab:devfrom
shijinpjlab:dev_0409

Conversation

@shijinpjlab
Copy link
Copy Markdown
Collaborator

No description provided.

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 introduces the RuleDictConsistency rule to compare metadata and context dictionaries for key and value consistency. The review feedback suggests refining the rule registration by using an empty list for groups instead of a list with an empty string and updating the class docstring to accurately reflect that it checks for both mismatched keys and values.

return res


@Model.rule_register("QUALITY_BAD_EFFECTIVENESS", [""])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The group name "" is unconventional. If this rule is not meant to be part of any group, it's better to use an empty list []. If it should belong to a group, please use a descriptive name. Using [""] will create a group with an empty string as its name, which is likely not the intention.

Suggested change
@Model.rule_register("QUALITY_BAD_EFFECTIVENESS", [""])
@Model.rule_register("QUALITY_BAD_EFFECTIVENESS", [])


@Model.rule_register("QUALITY_BAD_EFFECTIVENESS", [""])
class RuleDictConsistency(BaseRule):
"""Compare two dict fields and report mismatched keys."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The docstring is slightly inaccurate as it only mentions mismatched keys. The rule also checks for mismatched values for common keys. Please update the docstring to reflect the full behavior of the rule, which is better described in _metric_info.

Suggested change
"""Compare two dict fields and report mismatched keys."""
"""Compare two dict fields and report mismatched keys or values."""

@shijinpjlab shijinpjlab merged commit 4ab8f0b into MigoXLab:dev Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant