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

REF: factor out dataset and layer creation for ogr_write #351

Merged

Conversation

jorisvandenbossche
Copy link
Member

This just moves the setting up of the ogr dataset and layer objects for writing into a separate helper function, which should help with #346

@jorisvandenbossche
Copy link
Member Author

There is one failing build with GDAL main, but that's being addressed in #353

@kylebarron
Copy link
Contributor

Thanks!

Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

Just a couple of comments...

pyogrio/_io.pyx Outdated
object layer_kwargs, bint promote_to_multi=False, bint nan_as_null=True,
bint append=False, dataset_metadata=None, layer_metadata=None,
gdal_tz_offsets=None
cdef create_dataset_layer(
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a minimal docstring to this to indicate it returns a boolean to indicate that a new layer is created in the process (vs append to existing), that it sets ogr_dataset and ogr_layer pointers with valid objects on success and raise exceptions otherwise, and that it is then the responsibility of the caller to release those?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure!

pyogrio/_io.pyx Show resolved Hide resolved
Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

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

Thanks!

@jorisvandenbossche jorisvandenbossche merged commit 8142297 into geopandas:main Jan 29, 2024
19 checks passed
@jorisvandenbossche jorisvandenbossche deleted the ref-dataset-creation branch January 29, 2024 18:25
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.

None yet

3 participants