JacobHayes commented on PR #41538:
URL: https://github.com/apache/arrow/pull/41538#issuecomment-2094296695

   I'll push the fix after confirming the updates to the test fail as expected, 
but briefly the changes are:
   ```diff
   commit 7c986321aa7a8ef29499f99c09bb9797f0cfabb9
   Author: Jacob Hayes <[email protected]>
   Date:   Sat May 4 12:26:35 2024 -0400
   
       GH-38575: [Python] Include metadata when creating pa.schema from 
PyCapsule
   
   diff --git a/python/pyarrow/types.pxi b/python/pyarrow/types.pxi
   index 018099ae7..480f19c81 100644
   --- a/python/pyarrow/types.pxi
   +++ b/python/pyarrow/types.pxi
   @@ -5332,7 +5332,10 @@ def schema(fields, metadata=None):
        if isinstance(fields, Mapping):
            fields = fields.items()
        elif hasattr(fields, "__arrow_c_schema__"):
   -        return Schema._import_from_c_capsule(fields.__arrow_c_schema__())
   +        result = Schema._import_from_c_capsule(fields.__arrow_c_schema__())
   +        if metadata is not None:
   +            result = result.with_metadata(metadata)
   +        return result
    
        for item in fields:
            if isinstance(item, tuple):
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to