Skip to content

Conversation

@DEKHTIARJonathan
Copy link
Member

This PR replaces the following:

lambda v: validate_list_all_unique(
    v, key=attrgetter("feature_hash")
)

By the following:

lambda v: validate_list_all_unique(
    v, keys=("namespace", "feature")
)

The new validator is preferable (though equivalent) to avoid a cryptic error message:

# Before
variantlib.errors.ValidationError: Duplicate value found: '7153903334020990830' in list.

# After
variantlib.errors.ValidationError: Duplicate value found: '('my_namespace', 'my_feature')' in list.

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Copy link
Collaborator

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

LGTM

@DEKHTIARJonathan DEKHTIARJonathan merged commit ad53d13 into main Apr 15, 2025
16 checks passed
@DEKHTIARJonathan DEKHTIARJonathan deleted the validator_tuneup branch April 15, 2025 17:46
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.

3 participants