Skip to content

fix(deps): pin pandas below 3 until xarray can be upgraded - #273

Merged
KartikP merged 1 commit into
mainfrom
kp/pin-pandas-below-3
Nov 28, 2026
Merged

KartikP merged 1 commit into
mainfrom
kp/pin-pandas-below-3

Conversation

@KartikP

@KartikP KartikP commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #242.

Problem

Core pins xarray<2022.6 but leaves pandas unbounded. A core-only install can resolve pandas 3.0.x (pandas 3.1+ needs numpy 2, which core excludes). With pandas 3, write_netcdf fails for assemblies with string coordinates:

ValueError: unsupported dtype for netCDF4 variable: object

so package_data_assembly fails for typical assemblies. vision and language already pin pandas<3, so their installs are not affected. Jenkins does not catch this because its environment has pandas 2.

Change

Pin pandas<3, matching vision and language. Upgrading xarray is the long-term fix, but the xarray pin guards a known groupby bug (pydata/xarray#6836), so that is a separate change.

Verification

Clean Python 3.11 environments, brainscore_core/supported_data_standards/brainio/tests/test_packaging.py:

Environment Repro from #242 test_packaging.py
This branch (pandas 2.3.3, xarray 2022.3.0) writes 24 passed
Same with pandas 3.0.6 ValueError 4 failed: test_write_netcdf, test_package_data_assembly, test_package_extras, test_compression

@KartikP
KartikP merged commit 9d61600 into main Nov 28, 2026
4 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.

write_netcdf fails with pandas 3 for assemblies with string coordinates

1 participant