Skip to content

Commit 4647d01

Browse files
MaxGhenisclaude
andauthored
Bump policyengine-core to 3.23.5 for pandas 3.0 compatibility (#397)
* Bump policyengine-core to 3.23.5 for pandas 3.0 compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add test for pandas 3.0 enum encoding compatibility Tests that Enum.encode works correctly with pandas Series, verifying the policyengine-core 3.23.5 fix for pandas 3.0. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bbe1973 commit 4647d01

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
changed:
4+
- Bumped policyengine-core minimum version to 3.23.5 for pandas 3.0 compatibility

projects/policyengine-api-simulation/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies = [
1717
"opentelemetry-instrumentation-fastapi (>=0.51b0,<0.52)",
1818
"policyengine-fastapi",
1919
"policyengine==0.10.1",
20+
"policyengine-core>=3.23.5",
2021
"policyengine-uk>=2.22.8",
2122
"policyengine-us>=1.370.2",
2223
"tables>=3.10.2",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Test pandas 3.0 compatibility with enum encoding."""
2+
import pandas as pd
3+
from policyengine_core.enums import Enum
4+
5+
6+
class SampleEnum(Enum):
7+
VALUE_A = "value_a"
8+
VALUE_B = "value_b"
9+
10+
11+
def test_enum_encode_with_pandas_series():
12+
"""Test that Enum.encode works with pandas Series."""
13+
enum_items = [SampleEnum.VALUE_A, SampleEnum.VALUE_B, SampleEnum.VALUE_A]
14+
series = pd.Series(enum_items)
15+
16+
encoded = SampleEnum.encode(series)
17+
18+
assert len(encoded) == 3
19+
assert list(encoded) == [0, 1, 0]

0 commit comments

Comments
 (0)