From d6b4c64311504f53af4d2a851de3259166399b3e Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 14:30:56 +0200 Subject: [PATCH] fix(python): Update implementation of Enum support in `lit` to address spurious test failure --- py-polars/polars/functions/lit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-polars/polars/functions/lit.py b/py-polars/polars/functions/lit.py index 3d9a39c071cb..11ec98a08fda 100644 --- a/py-polars/polars/functions/lit.py +++ b/py-polars/polars/functions/lit.py @@ -130,7 +130,7 @@ def lit( elif isinstance(value, enum.Enum): lit_value = value.value if dtype is None and isinstance(value, str): - dtype = Enum(value.__class__.__members__.values()) + dtype = Enum(m.value for m in type(value)) return lit(lit_value, dtype=dtype) if dtype: