You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For geopackages, if we pass an invalid where expression that includes a column not present in the dataset, GDAL logs that to stderr but does not set an error or error message.
OGR_L_GetFeatureCount is returned as -1 in this case, which might be a clue that we need to look at output to stderr. Fix may be to add a custom error handler, at least around this function.
The text was updated successfully, but these errors were encountered:
In pull request #74 a test is added to check the result of an invalid where on amongst others a GPKG, and this indeed confirms this issue.
If this issue gets fixed, the test will need to be corrected as well:
def test_read_where_invalid(naturalearth_lowres_all_ext):
if naturalearth_lowres_all_ext.suffix in [".gpkg"]:
# Geopackage doesn't raise, but returns empty df?
gdf = read_dataframe(naturalearth_lowres_all_ext, where="invalid")
assert len(gdf) == 0
else:
with pytest.raises(ValueError, match="Invalid SQL"):
read_dataframe(naturalearth_lowres_all_ext, where="invalid")
Observed in GDAL 3.2.1
Need to research if this is an upstream bug.
For geopackages, if we pass an invalid
where
expression that includes a column not present in the dataset, GDAL logs that to stderr but does not set an error or error message.OGR_L_GetFeatureCount
is returned as -1 in this case, which might be a clue that we need to look at output to stderr. Fix may be to add a custom error handler, at least around this function.The text was updated successfully, but these errors were encountered: