diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..58659269 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + changed: + - Bumped policyengine-core minimum version to 3.23.5 for pandas 3.0 compatibility diff --git a/setup.py b/setup.py index 8cd00d38..85b3ae9e 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/tests/python/test_pandas3_compatibility.py b/tests/python/test_pandas3_compatibility.py new file mode 100644 index 00000000..98481aa1 --- /dev/null +++ b/tests/python/test_pandas3_compatibility.py @@ -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]