From 803913fbb9cefcaa8076e9cef2ba70254626bac4 Mon Sep 17 00:00:00 2001 From: Gagan Trivedi Date: Mon, 23 Sep 2024 11:12:20 +0530 Subject: [PATCH] make(map_any_value_to_trait_value): to use in core --- flag_engine/identities/traits/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flag_engine/identities/traits/types.py b/flag_engine/identities/traits/types.py index 6630445..4ec79b0 100644 --- a/flag_engine/identities/traits/types.py +++ b/flag_engine/identities/traits/types.py @@ -11,7 +11,7 @@ _UnconstrainedTraitValue = Union[None, int, float, bool, str] -def _map_any_value_to_trait_value(value: Any) -> _UnconstrainedTraitValue: +def map_any_value_to_trait_value(value: Any) -> _UnconstrainedTraitValue: """ Try to coerce a value of arbitrary type to a trait value type. Union member-specific constraints, such as max string value length, are ignored here. @@ -56,5 +56,5 @@ def _is_trait_value(value: Any) -> TypeGuard[_UnconstrainedTraitValue]: int, Annotated[str, StringConstraints(max_length=TRAIT_STRING_VALUE_MAX_LENGTH)], ], - BeforeValidator(_map_any_value_to_trait_value), + BeforeValidator(map_any_value_to_trait_value), ]