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

FIX: Only use transactions when writing features if layer supports them #203

Merged
merged 2 commits into from
Jan 14, 2023

Conversation

brendan-ward
Copy link
Member

OpenFileGDB now supports write from GDAL 3.6.0 onwards, but does not support transactions. We were always assuming transaction support was present because it was available for all drivers we specifically tested previously (though GDAL makes clear not all datasets / layers support transactions).

This adds a check for that capability and creates features without a transaction if layer doesn't support them, and adds a test to ensure that we can write OpenFileGDB correctly now.

@brendan-ward brendan-ward added this to the 0.5.0 milestone Jan 14, 2023
@@ -394,7 +410,7 @@ def test_write_supported(tmpdir, naturalearth_lowres, driver):
# we take the first record only.
meta["geometry_type"] = "MultiPolygon"

filename = tmpdir / "test"
filename = tmpdir / f"test{DRIVER_EXT[driver]}"
Copy link
Member Author

Choose a reason for hiding this comment

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

This was added because GDAL raises errors for some drivers if the extension is not what is required; i.e., even though we don't test OpenFileGDB in this block, it must have a .gdb extension. This is an attempt to future-proof adding additional drivers to DRIVERS.

@brendan-ward brendan-ward merged commit 144fc34 into main Jan 14, 2023
@brendan-ward brendan-ward deleted the fix_unsupported_transactions branch January 14, 2023 21:37
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 this pull request may close these issues.

2 participants