Skip to content

Commit

Permalink
fix(python): Update implementation of Enum support in lit to addres…
Browse files Browse the repository at this point in the history
…s spurious test failure (#17187)
  • Loading branch information
stinodego authored Jun 25, 2024
1 parent 7763bd4 commit 240f92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py-polars/polars/functions/lit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 240f92a

Please sign in to comment.