Open-EO / openeo-python-driver

Common parts of a Python driver implementation for OpenEO
Apache License 2.0
11 stars 6 forks source link

Failing unit tests "AttributeError: module 'fiona' has no attribute 'path'" #308

Closed soxofaan closed 2 months ago

soxofaan commented 2 months ago

unit tests started failing with

AttributeError: module 'fiona' has no attribute 'path'

e.g. from

openeogeotrellis/deploy/batch_job_metadata.py:155: in extract_result_metadata
    area = DriverVectorCube.from_fiona([agg_geometry.path]).get_area()
venv38/lib64/python3.8/site-packages/openeo_driver/datacube.py:402: in from_fiona
    gdf = gpd.read_file(paths[0], driver=driver)
venv38/lib64/python3.8/site-packages/geopandas/io/file.py:281: in _read_file
    return _read_file_fiona(
venv38/lib64/python3.8/site-packages/geopandas/io/file.py:299: in _read_file_fiona
    if _is_zip(str(path_or_bytes)):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/var/lib/jenkins/workspace/_openeo-geopyspark-driver_master/tests/data/multipolygon01.geojson'

    def _is_zip(path):
        """Check if a given path is a zipfile"""
>       parsed = fiona.path.ParsedPath.from_uri(path)
E       AttributeError: module 'fiona' has no attribute 'path'
soxofaan commented 2 months ago

there was a recent release of Fiona 1.10.0 with deprecation note

The fiona.path module will be removed in a future version. This, and the previously mentioned constants, were not meant to be used by projects downstream.

however the stack trace above seems to suggest fiona.path is not just deprecated but removed

soxofaan commented 2 months ago

probably this:

soxofaan commented 2 months ago

Also fails the openeo-python-driver unit tests, so moving it here

soxofaan commented 2 months ago

from https://github.com/Toblerity/Fiona/issues/1440: compatibility issue between geopandas and fiona is fixed since geopandas 0.14.4 but because we are still on python 3.8, we're stuck at geopandas<0.14 so for now, we will have go pin dosn fiona below 1.10.0

soxofaan commented 2 months ago

unit tests pass again