Conversation
There was a problem hiding this comment.
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", [""]) |
There was a problem hiding this comment.
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.
| @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.""" |
There was a problem hiding this comment.
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.
| """Compare two dict fields and report mismatched keys.""" | |
| """Compare two dict fields and report mismatched keys or values.""" |
No description provided.