Skip to content

DriverVectorCube.from_geojson incompatible with pandas 3 (just released) #459

Open

Description

@soxofaan
import pandas
import openeo_driver.datacube

print(pandas.__version__)
# 3.0.0

geometries = {
    'type': 'Feature',
    'geometry': {'type': 'Point', 'coordinates': [66, 52]},
    'properties': {'row_index': 1, 'description': 'foo'}
}
openeo_driver.datacube.DriverVectorCube.from_geojson(
    geometries
)
#  Cannot interpret '<StringDtype(na_value=nan)>' as a data type

snippet works with pandas<3.0.0

Activity

  1. soxofaan commented on Jan 22, 2026

    @soxofaan
    MemberAuthor

    full stack trace FYI

    >>> openeo_driver.datacube.DriverVectorCube.from_geojson(
    ...     geometries
    ... )
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/lippenss/src/openeo/openeo-python-driver/openeo_driver/datacube.py", line 507, in from_geojson
        return cls.from_geodataframe(gdf, columns_for_cube=columns_for_cube)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/lippenss/src/openeo/openeo-python-driver/openeo_driver/datacube.py", line 357, in from_geodataframe
        columns_for_cube = [c for c in available_columns if numpy.issubdtype(data[c].dtype, numpy.number)]
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/lippenss/src/openeo/openeo-python-driver/openeo_driver/datacube.py", line 357, in <listcomp>
        columns_for_cube = [c for c in available_columns if numpy.issubdtype(data[c].dtype, numpy.number)]
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/lippenss/src/openeo/openeo-python-driver/venv311/lib/python3.11/site-packages/numpy/_core/numerictypes.py", line 534, in issubdtype
        arg1 = dtype(arg1).type
               ^^^^^^^^^^^
    TypeError: Cannot interpret '<StringDtype(na_value=nan)>' as a data type
    
  2. added a commit that references this issue on Jan 22, 2026
  3. soxofaan commented on Jan 22, 2026

    @soxofaan
    MemberAuthor

    Quick draft PR attempt to fix pandas3 compatibility:

    let's see what CI thinks of it

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions