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 3c31fd68..8de66df8 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ install_requires=[ "anthropic", "Authlib>=1.3.1", + "policyengine-core>=3.23.5", "cloud-sql-python-connector", "flask>=2.2", "flask-cors>=3", diff --git a/tests/test_pandas3_compatibility.py b/tests/test_pandas3_compatibility.py new file mode 100644 index 00000000..98481aa1 --- /dev/null +++ b/tests/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]