arta icon indicating copy to clipboard operation
arta copied to clipboard

Improve feedback on missing rule_set argument

Open HugoPerrier opened this issue 1 month ago • 1 comments

Is your feature request related to a problem? Please describe

When the RulesEngine.apply_rules method is ran, if the rule_set argument is missing, A KeyError is raised with the message KeyError: "Rule set 'None' not found in the rules, available rule sets are : ['my_rule_set']."

This does not make it clear that you should set the rule_set argument

Describe the solution you'd like

  • Making the rule_set a mandatory argument (state that you should type "default to use the default rule set?)

Describe alternatives you've considered

  • Make the error message Clearer

HugoPerrier avatar Nov 18 '25 09:11 HugoPerrier

Hi, Currently, the rule is:

https://github.com/MAIF/arta/blob/65f0a66881f364901a7f08c364d3c0780580bf4c/src/arta/_engine.py#L234-L237

The goal is to prevent any misuse of a rule set when there are several in the configuration.

But it can change of course.

What do you think about a simpler (and backward compatible) solution: rule_set: str = "default_rule_set" in the apply_rules() definition?

develop-cs avatar Nov 20 '25 08:11 develop-cs