Skip to content

Commit

Permalink
Python bindings: Layer.WriteArrow(): add compatibility with DuckDB 1.…
Browse files Browse the repository at this point in the history
…1 __arrow_c_stream__()
  • Loading branch information
rouault committed Sep 10, 2024
1 parent cf67174 commit 91ef2f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swig/include/python/ogr_python.i
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,12 @@ def _WarnIfUserHasNotSpecifiedIfUsingExceptions():
requested_schema = requested_schema.__arrow_c_schema__()

if hasattr(obj, "__arrow_c_stream__"):
stream_capsule = obj.__arrow_c_stream__(requested_schema=requested_schema)
if requested_schema:
stream_capsule = obj.__arrow_c_stream__(requested_schema=requested_schema)
else:
# DuckDB 1.1 doesn't support the requested_schema argument at all
stream_capsule = obj.__arrow_c_stream__()
return self.WriteArrowStreamCapsule(stream_capsule, createFieldsFromSchema, options)
if hasattr(obj, "__arrow_c_array__"):
Expand Down

0 comments on commit 91ef2f1

Please sign in to comment.