Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jun 28, 2024

Revert changes in #3304 so that we can track the issue #3301.

Edit on 2024/12/03: Also revert #3668

Comment on lines 17 to 21
import pyogrio

# Read shapefile data using geopandas
pyogrio.core._register_drivers()
gdf = gpd.read_file(
Copy link
Member

@weiji14 weiji14 Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this issue geopandas/pyogrio#144 that mentions an error like pyogrio.errors.DataSourceError: Could not obtain driver: GPKG (check that it was installed correctly into GDAL) was due to drivers not being loaded properly. This should have been fixed in geopandas/pyogrio#145, but unsure why we're still hitting into this in the sphinx build and not in the regular tests.

Calling pyogrio.core._register_drivers() seems to get the GDAL drivers to register, so the build passes. But it doesn't look nice, and we should report this as a bug upstream if we can find a way to reproduce this outside of sphinx.

# %%
import geopandas as gpd
import pygmt
import pyogrio
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move it to conf.py so that we don't have to repeat it in multiple gallery examples?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried locally, no it doesn't work if I put it in doc/conf.py.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitating to merge this PR because (1) users may be confused about pyogrio.core._register_drivers(); (2) Users may still use geopandas v0.x and don't have pyogrio installed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, don't think it's a good option either. I just tried adding it to the Makefile and it doesn't work either.

The funny thing is, the examples/gallery/maps/choropleth_map.py example which also has a import geopandas as gpd line, and runs before the roads example, doesn't fail with the DataSourceError. If I move that choropleth_map.py file somewhere else, all the builds work without needing to register the driver manually 😅

Copy link
Member Author

@seisman seisman Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seisman seisman force-pushed the ci/unpin-geopandas branch from 2deb0d0 to e15462f Compare July 9, 2024 12:58
@seisman seisman force-pushed the ci/unpin-geopandas branch from e15462f to 9883359 Compare July 9, 2024 12:59
@seisman seisman marked this pull request as ready for review July 9, 2024 13:19
@seisman seisman changed the title CI: Unpin geopandas in the Docs workflow CI: Unpin geopandas in the Docs workflow and manually register gdal drivers as workaround Jul 9, 2024
@seisman seisman added the maintenance Boring but important stuff for the core devs label Jul 9, 2024
@seisman seisman added this to the 0.13.0 milestone Jul 9, 2024
@seisman seisman added needs review This PR has higher priority and needs review. and removed needs review This PR has higher priority and needs review. labels Jul 9, 2024
@seisman seisman marked this pull request as draft July 10, 2024 02:09
@seisman seisman modified the milestones: 0.13.0, 0.14.0 Aug 1, 2024
@seisman seisman removed this from the 0.14.0 milestone Sep 5, 2024
@seisman seisman self-assigned this Oct 30, 2024
@weiji14
Copy link
Member

weiji14 commented Dec 3, 2024

@seisman, maybe we should retry this again with rasterio=1.4.3, xref #3301 (comment).

@seisman seisman changed the title CI: Unpin geopandas in the Docs workflow and manually register gdal drivers as workaround CI: Unpin geopandas and rasterio Dec 3, 2024
@seisman seisman added this to the 0.14.0 milestone Dec 4, 2024
@seisman seisman added skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Dec 4, 2024
@seisman seisman changed the title CI: Unpin geopandas and rasterio CI: Unpin geopandas and rasterio after the fix in #3672 Dec 4, 2024
@seisman seisman merged commit a92d9d0 into main Dec 4, 2024
22 checks passed
@seisman seisman deleted the ci/unpin-geopandas branch December 4, 2024 07:08
@seisman seisman removed the needs review This PR has higher priority and needs review. label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants