From 240f92a232405b4039dd1ac120b2111fa7a7f476 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 20:44:29 +0200 Subject: [PATCH] fix(python): Update implementation of Enum support in `lit` to address spurious test failure (#17187) --- 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: