Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure to catch and propagate errors when calling GDALClose #221

Closed
jorisvandenbossche opened this issue Feb 13, 2023 · 2 comments · Fixed by #284
Closed

Ensure to catch and propagate errors when calling GDALClose #221

jorisvandenbossche opened this issue Feb 13, 2023 · 2 comments · Fixed by #284
Milestone

Comments

@jorisvandenbossche
Copy link
Member

See Toblerity/Fiona#1169 (and fix in fiona: Toblerity/Fiona@04ad6c8) for context.

I think we have the same issue as fiona that we are not checking for errors when "closing" the dataset when writing, while the writing can still go wrong at that point, and so this wouldn't bubble up to users.

@jorisvandenbossche
Copy link
Member Author

Although if I run the equivalent pyogrio code from the fiona test case, we already get an error:

In [63]: pyogrio.write_dataframe(df, "s3://non-existing-bucket/test.geojson", driver="GeoJSON")
ERROR 4: Failed to create GeoJSON datasource: s3://non-existing-bucket/test.geojson: s3://non-existing-bucket/test.geojson: No such file or directory
...
~/scipy/repos/pyogrio/pyogrio/_io.pyx in pyogrio._io.ogr_write()

~/scipy/repos/pyogrio/pyogrio/_io.pyx in pyogrio._io.ogr_create()

DataSourceError: Failed to create GeoJSON datasource: s3://non-existing-bucket/test.geojson: s3://non-existing-bucket/test.geojson: No such file or directory

@brendan-ward brendan-ward added this to the 0.6.0 milestone Feb 13, 2023
@brendan-ward brendan-ward modified the milestones: 0.6.0, 0.7.0 Apr 24, 2023
@brendan-ward
Copy link
Member

We're getting an error because we aren't properly handling s3://... protocol for writing. We use get_vsi_path elsewhere for reading, which converts that to /vsis3/....

If you instead attempt to write pyogrio.write_dataframe(df, "/vsis3/non-existing-bucket/test.geojson", driver="GeoJSON")

it fails silently.
(working on a fix now for both issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants