Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Fixes filled_array() to handle pandas ExtensionDtype (StringDtype) that becomes default in pandas 3
  • Fixes VectorialParameterNodeAtInstant.__getitem__ to handle StringArray from pandas 3
  • Adds comprehensive test suite for pandas 3 compatibility

Test plan

  • All 7 new pandas 3 compatibility tests pass
  • All 465 existing core tests pass (no regressions)
  • CI passes

Fixes issues reported in policyengine-uk#1489 and related to pandas 3.0.0 release.

🤖 Generated with Claude Code

MaxGhenis and others added 5 commits January 24, 2026 10:18
Fixes two issues that occur with pandas 3.0's new defaults:

1. filled_array() now handles pandas ExtensionDtype (StringDtype)
   - numpy.full() cannot handle StringDtype, so convert to object dtype
   - Fixes: TypeError: Cannot interpret '<StringDtype>' as a data type

2. VectorialParameterNodeAtInstant.__getitem__ now handles StringArray
   - pandas 3 returns StringArray instead of numpy array for string operations
   - Convert pandas arrays to numpy before processing
   - Fixes: TypeError: unhashable type: 'StringArray'

Added comprehensive tests that verify both fixes work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 04f9927 into master Jan 24, 2026
14 checks passed
@MaxGhenis MaxGhenis deleted the pandas-3-compatibility branch January 24, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants