Skip to content

Conversation

@EwoutH
Copy link
Member

@EwoutH EwoutH commented Dec 3, 2025

Replace np.issubdtype() with pandas.api.types.is_numeric_dtype() to fix compatibility with pandas 3.0's new StringDtype.

NumPy's np.issubdtype() cannot handle pandas ExtensionDtype objects, particularly the new StringDtype introduced as default in pandas 3.0. This caused TypeError when checking if color columns were numeric:

"Cannot interpret '<StringDtype(storage='python', na_value=nan)>' as a data type"

Using pandas' is_numeric_dtype() provides several benefits:

  • Correctly handles all pandas dtypes (native NumPy and extension types)
  • Works with numeric extension dtypes (Int64, Float64, Decimal, etc.)
  • Compatible with both pandas 2.x and 3.x
  • More semantically clear - checks if data is numeric rather than checking dtype inheritance hierarchy

Replace np.issubdtype() with pandas.api.types.is_numeric_dtype() to fix compatibility with pandas 3.0's new StringDtype.

NumPy's np.issubdtype() cannot handle pandas ExtensionDtype objects, particularly the new StringDtype introduced as default in pandas 3.0. This caused TypeError when checking if color columns were numeric: "Cannot interpret '<StringDtype(storage='python', na_value=nan)>' as a data type"

Using pandas' is_numeric_dtype() provides several benefits:
- Correctly handles all pandas dtypes (native NumPy and extension types)
- Works with numeric extension dtypes (Int64, Float64, Decimal, etc.)
- Compatible with both pandas 2.x and 3.x
- More semantically clear - checks if data is numeric rather than
  checking dtype inheritance hierarchy
@EwoutH EwoutH added the bug Release notes label label Dec 3, 2025
@EwoutH
Copy link
Member Author

EwoutH commented Dec 3, 2025

The CI is still failing on another, unrelated error:

AttributeError: module 'reacton.ipyvuetify' has no attribute 'TabsItems'

I will try to address that in another PR.

@EwoutH EwoutH marked this pull request as ready for review December 3, 2025 18:23
@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants