Skip to content

Commit a1627b9

Browse files
authored
GH-45003: [Python][Docs] Update docstrings for metadata methods on Field and Schema classes (#45004)
### Rationale for this change The docstrings here are not completely accurate. See #45003. I looked at whether it would make more sense or be more natural for methods like these to return an empty `dict` instead of None and I think None feels better from an API design and usage perspective. ### What changes are included in this PR? Updated docstrings to reflect actual behavior. ### Are these changes tested? While the changes don't need testing, I did check to see if we have unit tests for the behavior that's been documented here. We do. ### Are there any user-facing changes? Accurate docs. * GitHub Issue: #45003 Authored-by: Bryce Mecum <petridish@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 9016a83 commit a1627b9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/pyarrow/types.pxi

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,7 +2549,11 @@ cdef class Field(_Weakrefable):
25492549
@property
25502550
def metadata(self):
25512551
"""
2552-
The field metadata.
2552+
The field metadata (if any is set).
2553+
2554+
Returns
2555+
-------
2556+
metadata : dict or None
25532557
25542558
Examples
25552559
--------
@@ -2982,11 +2986,11 @@ cdef class Schema(_Weakrefable):
29822986
@property
29832987
def metadata(self):
29842988
"""
2985-
The schema's metadata.
2989+
The schema's metadata (if any is set).
29862990
29872991
Returns
29882992
-------
2989-
metadata: dict
2993+
metadata: dict or None
29902994
29912995
Examples
29922996
--------

0 commit comments

Comments
 (0)