Skip to content

Commit

Permalink
fix: compare validation now expects singular noun
Browse files Browse the repository at this point in the history
On pydantic-code >= 2.12, the validation error messages use the singular
of the word "character" when the number 1 is specified in a condition.
This breaks the engine.compare validation, which expected the plural.

Refs: jaraco#204
Signed-off-by: Jaremy Hatler <[email protected]>
  • Loading branch information
jhatler committed Dec 24, 2023
1 parent eff29a4 commit f6177e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ def compare(self, word1: Word, word2: Word) -> Union[str, bool]:
...
pydantic...ValidationError: ...
...
...at least 1 characters...
...at least 1 character...
"""
norms = self.plural_noun, self.plural_verb, self.plural_adj
results = (self._plequal(word1, word2, norm) for norm in norms)
Expand Down

0 comments on commit f6177e1

Please sign in to comment.