Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
changed:
- Bumped policyengine-core minimum version to 3.23.5 for pandas 3.0 compatibility
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"policyengine-il==0.1.0",
"policyengine_uk==2.39.0",
"policyengine_us==1.514.0",
"policyengine_core>=3.16.6",
"policyengine_core>=3.23.5",
"policyengine>=0.7.0",
"pydantic",
"pymysql",
Expand Down
20 changes: 20 additions & 0 deletions tests/python/test_pandas3_compatibility.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Test pandas 3.0 compatibility with enum encoding."""

import pandas as pd
from policyengine_core.enums import Enum


class SampleEnum(Enum):
VALUE_A = "value_a"
VALUE_B = "value_b"


def test_enum_encode_with_pandas_series():
"""Test that Enum.encode works with pandas Series."""
enum_items = [SampleEnum.VALUE_A, SampleEnum.VALUE_B, SampleEnum.VALUE_A]
series = pd.Series(enum_items)

encoded = SampleEnum.encode(series)

assert len(encoded) == 3
assert list(encoded) == [0, 1, 0]
Loading