geopandas / pyogrio

Vectorized vector I/O using OGR
https://pyogrio.readthedocs.io
MIT License
257 stars 21 forks source link

FIX: correctly ignore fields when reading data #391

Closed brendan-ward closed 2 months ago

brendan-ward commented 2 months ago

Resolves #388

Drivers will return inconsistent results when columns does not include the columns referenced in where expression. For some drivers, this will either return 0 results or raise an exception; other drivers appear to work without issue (GPKG, GeoJSON). Added documentation to indicate that users should include the column used by where in their list of columns.

The test added here verifies that fields are indeed ignored by GDAL (previously they weren't properly ignored).

brendan-ward commented 2 months ago

Added changelog entry to call this out as a potentially breaking change, since switching from the incorrect behavior that existed prior to this PR to the latest will now break folks that relied on this (myself included).