stactools-packages / goes-glm

stactools package for the Geostationary Lightning Mapper (GLM) on the GOES satellites
Other
2 stars 1 forks source link

Remove proprietary access to geopandas API #10

Closed m-mohr closed 2 years ago

m-mohr commented 2 years ago

Due to bug https://github.com/geopandas/geopandas/issues/2495 in geopandas, we are using a non-public API until the bug is solved. We need to set version 2.6 of arrow to be able to export datetimes with nano-second precision, which is required for lightning.

    # Convert using private API until the following bug is solved:
    # https://github.com/geopandas/geopandas/issues/2495
    # Replace later with somethine like:
    # dataframe.to_parquet(file, version = "2.6")
    import geopandas as gp

    table = gp.io.arrow._geopandas_to_arrow(dataframe)
    import pyarrow.parquet as pq

    pq.write_table(table, file, version="2.6")

See: https://github.com/stactools-packages/goes-glm/blob/main/src/stactools/goes_glm/parquet.py#L124

with

    dataframe.to_parquet(file, version = "2.6")
m-mohr commented 2 years ago

Is now available in v0.11.1, so I need to update the dependency and replace the code block.