Skip to content

Comments

remove pandas < 3 requirement#550

Merged
kaklise merged 4 commits intoUSEPA:mainfrom
kbonney:pandas3-fix
Feb 9, 2026
Merged

remove pandas < 3 requirement#550
kaklise merged 4 commits intoUSEPA:mainfrom
kbonney:pandas3-fix

Conversation

@kbonney
Copy link
Collaborator

@kbonney kbonney commented Feb 9, 2026

Summary

The testing errors resulting from Pandas 3.0 are caused by the migration to a new default string type StringDtype. This PR resolves two issues that stem from this change:

  • In Pandas 3.0, NaN values are preserved when converting to dict, rather than the old behavior of coercing them to None. A fix is added by converting NaN to None in from_dict where Nones are expected.

  • In some tests, we are still expecting the object dtype for certain string columns. A fix is added by coercing StringDtypes to object before running assertions. This maintains backwards compatibility with tests running with Pandas<3.0.

From the Pandas 3.0 Migration Guide:

Pandas 3.0 changes the default dtype for strings to a new string data type, a variant of the existing optional string data type but using NaN as the missing value indicator, to be consistent with the other default data types.

Tests and documentation

New features require tests and documentation.

Acknowledgement

By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.

@coveralls
Copy link

Coverage Status

coverage: 81.471% (-0.01%) from 81.484%
when pulling 13d887f on kbonney:pandas3-fix
into e0791b7 on USEPA:main.

@kaklise kaklise merged commit ad3d553 into USEPA:main Feb 9, 2026
77 of 84 checks passed
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.

3 participants