Skip to content

Fix!: Add model default audits in the model preserving their args#5106

Merged
themisvaltinos merged 3 commits intomainfrom
themis/used_audits
Aug 8, 2025
Merged

Fix!: Add model default audits in the model preserving their args#5106
themisvaltinos merged 3 commits intomainfrom
themis/used_audits

Conversation

@themisvaltinos
Copy link
Contributor

This update ensures that audit arguments from default_audits are no longer dropped when model audits are present.
Previously, if a model defined its own audits, only those were retained and the arguments from default_audits were silently dropped (since we used the audit_definitions with empty args). This adds both in the model's audits, preserving them along with their arguments.

@themisvaltinos
Copy link
Contributor Author

addressed comments and merged audits before passing to klass let me know if this looks better @izeigerman

model_audits = kwargs.pop("audits", [])
default_audits = defaults.pop("audits", [])

if isinstance(model_audits, (exp.Tuple, exp.Array)):
Copy link
Contributor

Choose a reason for hiding this comment

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

This block looks like something that could be an utility function and doesn't have to be a part of _create_model

Copy link
Contributor

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

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

Housekeeping comment, LGTM otherwise

@themisvaltinos themisvaltinos merged commit 9eba5c1 into main Aug 8, 2025
28 of 31 checks passed
@themisvaltinos themisvaltinos deleted the themis/used_audits branch August 8, 2025 20:53
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.

2 participants