Skip to content

Commit bb33493

Browse files
authored
MINOR: [Docs][Python] Fix usage of pyarrow and PyArrow in extending_types.rst (apache#47170)
### Rationale for this change I originally started this patch because the title of https://arrow.apache.org/docs/python/extending_types.html is "Extending pyarrow..." which immediately jumped out as me as not quite right: It should be "Extending PyArrow..." since PyArrow is the name of the software. I think we try to use the all-lowercase form only in code snippets or when specifically referring to the spelling of PyArrow various distributions. ### What changes are included in this PR? Changed docs/source/python/extending_types.rst to hopefully use the various forms correctly I didn't do a deep-dive into other docs. ### Are these changes tested? Yes, rendered locally. ### Are there any user-facing changes? No. Authored-by: Bryce Mecum <[email protected]> Signed-off-by: AlenkaF <[email protected]>
1 parent 321cc1b commit bb33493

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/source/python/extending_types.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.. currentmodule:: pyarrow
1919
.. _extending_types:
2020

21-
Extending pyarrow
21+
Extending PyArrow
2222
=================
2323

2424
Controlling conversion to (Py)Arrow with the PyCapsule Interface
@@ -80,8 +80,8 @@ Field.
8080

8181
.. _arrow_array_protocol:
8282

83-
Controlling conversion to pyarrow.Array with the ``__arrow_array__`` protocol
84-
-----------------------------------------------------------------------------
83+
Controlling conversion to ``pyarrow.Array`` with the ``__arrow_array__`` protocol
84+
---------------------------------------------------------------------------------
8585

8686
The :func:`pyarrow.array` function has built-in support for Python sequences,
8787
numpy arrays and pandas 1D objects (Series, Index, Categorical, ..) to convert
@@ -97,7 +97,7 @@ define the ``__arrow_array__`` method to return an Arrow array::
9797
...
9898

9999
def __arrow_array__(self, type=None):
100-
# convert the underlying array values to a pyarrow Array
100+
# convert the underlying array values to a PyArrow Array
101101
import pyarrow
102102
return pyarrow.array(..., type=type)
103103

@@ -436,7 +436,7 @@ Using the pandas period type from above as example, this would look like::
436436
return pd.PeriodDtype(freq=self.freq)
437437

438438
Secondly, the pandas ``ExtensionDtype`` on its turn needs to have the
439-
``__from_arrow__`` method implemented: a method that given a pyarrow Array
439+
``__from_arrow__`` method implemented: a method that given a PyArrow Array
440440
or ChunkedArray of the extension type can construct the corresponding
441441
pandas ``ExtensionArray``. This method should have the following signature::
442442

@@ -447,7 +447,7 @@ pandas ``ExtensionArray``. This method should have the following signature::
447447
def __from_arrow__(self, array: pyarrow.Array/ChunkedArray) -> pandas.ExtensionArray:
448448
...
449449

450-
This way, you can control the conversion of a pyarrow ``Array`` of your pyarrow
450+
This way, you can control the conversion of a PyArrow ``Array`` of your PyArrow
451451
extension type to a pandas ``ExtensionArray`` that can be stored in a DataFrame.
452452

453453

@@ -456,7 +456,7 @@ Canonical extension types
456456

457457
You can find the official list of canonical extension types in the
458458
:ref:`format_canonical_extensions` section. Here we add examples on how to
459-
use them in pyarrow.
459+
use them in PyArrow.
460460

461461
Fixed size tensor
462462
"""""""""""""""""
@@ -572,7 +572,7 @@ And also the other way around, we can convert a numpy ndarray to a fixed shape t
572572
]
573573
]
574574
575-
With the conversion the first dimension of the ndarray becomes the length of the pyarrow extension
575+
With the conversion the first dimension of the ndarray becomes the length of the PyArrow extension
576576
array. We can see in the example that ndarray of shape ``(3, 2, 2)`` becomes an arrow array of
577577
length 3 with tensor elements of shape ``(2, 2)``.
578578

0 commit comments

Comments
 (0)