Skip to content

Commit ed7ce76

Browse files
authored
DOC: Highlight dtype_backend with note (#51037)
* DOC: Highlight dtype_backend with note * Add note * Add another note
1 parent 0d43f68 commit ed7ce76

File tree

10 files changed

+92
-51
lines changed

10 files changed

+92
-51
lines changed

pandas/core/tools/numeric.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ def to_numeric(
9191
set to True, nullable dtypes are used for all dtypes that have a nullable
9292
implementation, even if no nulls are present.
9393
94+
.. note::
95+
96+
The nullable dtype implementation can be configured by calling
97+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
98+
numpy-backed nullable dtypes or
99+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
100+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
101+
102+
.. versionadded:: 2.0.0
103+
94104
Returns
95105
-------
96106
ret

pandas/io/clipboards.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ def read_clipboard(
3636
set to True, nullable dtypes are used for all dtypes that have a nullable
3737
implementation, even if no nulls are present.
3838
39-
The nullable dtype implementation can be configured by calling
40-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
41-
numpy-backed nullable dtypes or
42-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
43-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
44-
This is only implemented for the ``python``
45-
engine.
39+
.. note::
40+
41+
The nullable dtype implementation can be configured by calling
42+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
43+
numpy-backed nullable dtypes or
44+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
45+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
46+
This is only implemented for the ``python``
47+
engine.
4648
4749
.. versionadded:: 2.0
4850

pandas/io/excel/_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@
278278
set to True, nullable dtypes are used for all dtypes that have a nullable
279279
implementation, even if no nulls are present. Dtype takes precedence if given.
280280
281+
.. note::
282+
283+
The nullable dtype implementation can be configured by calling
284+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
285+
numpy-backed nullable dtypes or
286+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
287+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
288+
281289
.. versionadded:: 2.0
282290
283291
Returns

pandas/io/feather_format.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ def read_feather(
131131
set to True, nullable dtypes are used for all dtypes that have a nullable
132132
implementation, even if no nulls are present.
133133
134-
The nullable dtype implementation can be configured by calling
135-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
136-
numpy-backed nullable dtypes or
137-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
138-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
134+
.. note::
135+
136+
The nullable dtype implementation can be configured by calling
137+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
138+
numpy-backed nullable dtypes or
139+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
140+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
139141
140142
.. versionadded:: 2.0
141143

pandas/io/html.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,11 +1145,13 @@ def read_html(
11451145
set to True, nullable dtypes are used for all dtypes that have a nullable
11461146
implementation, even if no nulls are present.
11471147
1148-
The nullable dtype implementation can be configured by calling
1149-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
1150-
numpy-backed nullable dtypes or
1151-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
1152-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
1148+
.. note::
1149+
1150+
The nullable dtype implementation can be configured by calling
1151+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
1152+
numpy-backed nullable dtypes or
1153+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
1154+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
11531155
11541156
.. versionadded:: 2.0
11551157

pandas/io/json/_json.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,13 @@ def read_json(
643643
set to True, nullable dtypes are used for all dtypes that have a nullable
644644
implementation, even if no nulls are present.
645645
646-
The nullable dtype implementation can be configured by calling
647-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
648-
numpy-backed nullable dtypes or
649-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
650-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
646+
.. note::
647+
648+
The nullable dtype implementation can be configured by calling
649+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
650+
numpy-backed nullable dtypes or
651+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
652+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
651653
652654
.. versionadded:: 2.0
653655

pandas/io/orc.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,19 @@ def read_orc(
5959
This mirrors the original behaviour of
6060
:external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`.
6161
use_nullable_dtypes : bool, default False
62-
If True, use dtypes that use ``pd.NA`` as missing value indicator
63-
for the resulting DataFrame.
62+
Whether or not to use nullable dtypes as default when reading data. If
63+
set to True, nullable dtypes are used for all dtypes that have a nullable
64+
implementation, even if no nulls are present.
6465
65-
The nullable dtype implementation can be configured by calling
66-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
67-
numpy-backed nullable dtypes or
68-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
69-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
66+
.. note::
7067
71-
.. versionadded:: 2.0.0
68+
The nullable dtype implementation can be configured by calling
69+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
70+
numpy-backed nullable dtypes or
71+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
72+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
7273
73-
.. note
74-
75-
Currently only ``mode.dtype_backend`` set to ``"pyarrow"`` is supported.
74+
.. versionadded:: 2.0
7675
7776
**kwargs
7877
Any additional kwargs are passed to pyarrow.

pandas/io/parquet.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,15 @@ def read_parquet(
497497
498498
.. versionadded:: 1.2.0
499499
500-
The nullable dtype implementation can be configured by calling
501-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
502-
numpy-backed nullable dtypes or
503-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
504-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
500+
.. note::
505501
506-
.. versionadded:: 2.0.0
502+
The nullable dtype implementation can be configured by calling
503+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
504+
numpy-backed nullable dtypes or
505+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
506+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
507+
508+
.. versionadded:: 2.0.0
507509
508510
**kwargs
509511
Any additional kwargs are passed to the engine.

pandas/io/parsers/readers.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,15 @@
401401
set to True, nullable dtypes are used for all dtypes that have a nullable
402402
implementation, even if no nulls are present.
403403
404-
The nullable dtype implementation can be configured by calling
405-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
406-
numpy-backed nullable dtypes or
407-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
408-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
409-
This is only implemented for the ``pyarrow`` or ``python``
410-
engines.
404+
.. note::
405+
406+
The nullable dtype implementation can be configured by calling
407+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
408+
numpy-backed nullable dtypes or
409+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
410+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
411+
This is only implemented for the ``pyarrow`` or ``python``
412+
engines.
411413
412414
.. versionadded:: 2.0
413415
@@ -1283,6 +1285,16 @@ def read_fwf(
12831285
set to True, nullable dtypes are used for all dtypes that have a nullable
12841286
implementation, even if no nulls are present.
12851287
1288+
.. note::
1289+
1290+
The nullable dtype implementation can be configured by calling
1291+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
1292+
numpy-backed nullable dtypes or
1293+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
1294+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
1295+
This is only implemented for the ``pyarrow`` or ``python``
1296+
engines.
1297+
12861298
.. versionadded:: 2.0
12871299
12881300
**kwds : optional

pandas/io/xml.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,13 @@ def read_xml(
988988
set to True, nullable dtypes are used for all dtypes that have a nullable
989989
implementation, even if no nulls are present.
990990
991-
The nullable dtype implementation can be configured by calling
992-
``pd.set_option("mode.dtype_backend", "pandas")`` to use
993-
numpy-backed nullable dtypes or
994-
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
995-
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
991+
.. note::
992+
993+
The nullable dtype implementation can be configured by calling
994+
``pd.set_option("mode.dtype_backend", "pandas")`` to use
995+
numpy-backed nullable dtypes or
996+
``pd.set_option("mode.dtype_backend", "pyarrow")`` to use
997+
pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``).
996998
997999
.. versionadded:: 2.0
9981000

0 commit comments

Comments
 (0)