From 61810c5a1137547afb8427108bf51c4a1342587a Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sat, 22 Jun 2024 21:16:01 +0800 Subject: [PATCH 01/13] DOC: More doc fix for dtype_backend --- pandas/core/dtypes/cast.py | 12 ++++---- pandas/core/generic.py | 16 +++++----- pandas/io/clipboards.py | 12 ++++---- pandas/io/orc.py | 12 ++++---- pandas/io/spss.py | 12 ++++---- pandas/io/sql.py | 60 +++++++++++++++++++------------------- 6 files changed, 62 insertions(+), 62 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 662b8c5791e51..f66174deb5888 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1011,14 +1011,14 @@ def convert_dtypes( infer_objects : bool, defaults False Whether to also infer objects to float/int if possible. Is only hit if the object array contains pd.NA. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b4908ad7a2158..bbf2ed38a258c 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6650,14 +6650,14 @@ def convert_dtypes( Whether, if possible, conversion can be done to floating extension types. If `convert_integer` is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' - Back-end data type applied to the resultant :class:`DataFrame` or - :class:`Series` (still experimental). Behaviour is as follows: - - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - or :class:`Series` (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame or Series. + dtype_backend : {'numpy_nullable', 'pyarrow'} + Back-end data type applied to the resultant :class:`DataFrame` + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: + + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index 5a0a8c321e629..5bf6d27e1b0ac 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -38,14 +38,14 @@ def read_clipboard( A string or regex delimiter. The default of ``'\\s+'`` denotes one or more whitespace characters. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/orc.py b/pandas/io/orc.py index 3bca8ea7ef1df..cd8baabf8745a 100644 --- a/pandas/io/orc.py +++ b/pandas/io/orc.py @@ -61,14 +61,14 @@ def read_orc( Output always follows the ordering of the file and not the columns list. This mirrors the original behaviour of :external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/spss.py b/pandas/io/spss.py index 313ffa79cbd09..ee5ed3ca2fc16 100644 --- a/pandas/io/spss.py +++ b/pandas/io/spss.py @@ -36,14 +36,14 @@ def read_spss( Return a subset of the columns. If None, return all columns. convert_categoricals : bool, default is True Convert categorical columns into pd.Categorical. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 41b368c9b05c2..1e22322dddec3 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -306,14 +306,14 @@ def read_sql_table( chunksize : int, default None If specified, returns an iterator where `chunksize` is the number of rows to include in each chunk. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -443,14 +443,14 @@ def read_sql_query( {'a': np.float64, 'b': np.int32, 'c': 'Int64'}. .. versionadded:: 1.3.0 - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -586,14 +586,14 @@ def read_sql( chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 dtype : Type name or dict of columns @@ -1683,14 +1683,14 @@ def read_table( chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -2148,14 +2148,14 @@ def read_table( schema of the SQL database object. chunksize : int, default None Raises NotImplementedError - dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 From c9ea0dfc2bd14700c3f171215b95a6d0f39fe6e5 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sat, 22 Jun 2024 21:28:07 +0800 Subject: [PATCH 02/13] fix more --- pandas/io/excel/_base.py | 24 ++++++++++++------------ pandas/io/feather_format.py | 12 ++++++------ pandas/io/html.py | 12 ++++++------ pandas/io/json/_json.py | 12 ++++++------ pandas/io/parquet.py | 12 ++++++------ pandas/io/parsers/readers.py | 12 ++++++------ pandas/io/xml.py | 12 ++++++------ 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index de0ef3728fb6e..98f4f4507834b 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -267,14 +267,14 @@ Rows at the end to skip (0-indexed). {storage_options} -dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' +dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -1728,14 +1728,14 @@ def parse( comment string and the end of the current line is ignored. skipfooter : int, default 0 Rows at the end to skip (0-indexed). - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 **kwds : dict, optional diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 16d4e1f9ea25d..f72912449b8d4 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -92,14 +92,14 @@ def read_feather( Whether to parallelize reading using multiple threads. {storage_options} - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/html.py b/pandas/io/html.py index db4c5f8507946..804fe781ec538 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1131,14 +1131,14 @@ def read_html( .. versionadded:: 1.5.0 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 74e6595a7f0f2..0dcc6106c3635 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -649,14 +649,14 @@ def read_json( {storage_options} - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 306b144811898..01c352c4fc7b0 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -542,14 +542,14 @@ def read_parquet( .. versionadded:: 1.3.0 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 8a07c99b0fe94..02830f5f9303a 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -443,14 +443,14 @@ class _read_shared(TypedDict, Generic[HashableT], total=False): {storage_options} -dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' +dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 8c7381a926e72..caadbcd2b20ff 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -959,14 +959,14 @@ def read_xml( {storage_options} - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + dtype_backend : {'numpy_nullable', 'pyarrow'} Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + (still experimental). If not specified, the default behavior + is to not use nullable data types. If specified, the behavior + is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). - * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 From bb164cbdbf814a0b4eafa8bd3a92f2b1a3f21b43 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sat, 22 Jun 2024 21:36:58 +0800 Subject: [PATCH 03/13] fix braces --- pandas/io/excel/_base.py | 2 +- pandas/io/feather_format.py | 2 +- pandas/io/html.py | 2 +- pandas/io/json/_json.py | 2 +- pandas/io/parquet.py | 2 +- pandas/io/parsers/readers.py | 2 +- pandas/io/xml.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 98f4f4507834b..c94a9e1e5b311 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -267,7 +267,7 @@ Rows at the end to skip (0-indexed). {storage_options} -dtype_backend : {'numpy_nullable', 'pyarrow'} +dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index f72912449b8d4..0f1d701a0783d 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -92,7 +92,7 @@ def read_feather( Whether to parallelize reading using multiple threads. {storage_options} - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/html.py b/pandas/io/html.py index 804fe781ec538..89964cca59854 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1131,7 +1131,7 @@ def read_html( .. versionadded:: 1.5.0 - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 0dcc6106c3635..a39adf2699640 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -649,7 +649,7 @@ def read_json( {storage_options} - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 01c352c4fc7b0..3f1e1d85db548 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -542,7 +542,7 @@ def read_parquet( .. versionadded:: 1.3.0 - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 02830f5f9303a..3a8f58926f350 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -443,7 +443,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False): {storage_options} -dtype_backend : {'numpy_nullable', 'pyarrow'} +dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior diff --git a/pandas/io/xml.py b/pandas/io/xml.py index caadbcd2b20ff..402823b6e7afb 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -959,7 +959,7 @@ def read_xml( {storage_options} - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior From f5ec58f26f08e944cae439bccee940b7ad4f9b46 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sat, 22 Jun 2024 21:38:25 +0800 Subject: [PATCH 04/13] fix braces --- pandas/io/excel/_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index c94a9e1e5b311..f21346658f8e6 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -1728,7 +1728,7 @@ def parse( comment string and the end of the current line is ignored. skipfooter : int, default 0 Rows at the end to skip (0-indexed). - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {{'numpy_nullable', 'pyarrow'}} Back-end data type applied to the resultant :class:`DataFrame` (still experimental). If not specified, the default behavior is to not use nullable data types. If specified, the behavior From 64f17d58292fe75adae91db1400092cca6acd18e Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sun, 23 Jun 2024 09:34:50 +0800 Subject: [PATCH 05/13] Fix wrong default --- pandas/core/dtypes/cast.py | 6 ++---- pandas/core/generic.py | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index f66174deb5888..afea674325a5e 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1011,11 +1011,9 @@ def convert_dtypes( infer_objects : bool, defaults False Whether to also infer objects to float/int if possible. Is only hit if the object array contains pd.NA. - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). If not specified, the default behavior - is to not use nullable data types. If specified, the behavior - is as follows: + (still experimental). If specified, the behavior is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` diff --git a/pandas/core/generic.py b/pandas/core/generic.py index bbf2ed38a258c..563bd07ba5468 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6650,11 +6650,9 @@ def convert_dtypes( Whether, if possible, conversion can be done to floating extension types. If `convert_integer` is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers. - dtype_backend : {'numpy_nullable', 'pyarrow'} + dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). If not specified, the default behavior - is to not use nullable data types. If specified, the behavior - is as follows: + (still experimental). If specified, the behavior is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` From 4087a6d6dc72d8d2982758838a7fc0f163119fdf Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Thu, 4 Jul 2024 21:52:24 +0800 Subject: [PATCH 06/13] Improve --- pandas/core/dtypes/cast.py | 2 +- pandas/core/generic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 091c9edda3f4c..d3a2d59015762 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1012,7 +1012,7 @@ def convert_dtypes( object array contains pd.NA. dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). If specified, the behavior is as follows: + (still experimental). Behavior is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b21a6bc8ed4df..eaf8ffeff3460 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6652,8 +6652,8 @@ def convert_dtypes( If `convert_integer` is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers. dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' - Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). If specified, the behavior is as follows: + Back-end data type applied to the resultant :class:`DataFrame` or + :class:`Series` (still experimental). Behavior is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` From 583a1a7c893de41ad2af238fadab37fc8929a090 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Thu, 4 Jul 2024 21:57:33 +0800 Subject: [PATCH 07/13] typo --- pandas/core/dtypes/cast.py | 2 +- pandas/core/generic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index d3a2d59015762..e765cba80a593 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1012,7 +1012,7 @@ def convert_dtypes( object array contains pd.NA. dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behavior is as follows: + (still experimental). Behaviour is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` diff --git a/pandas/core/generic.py b/pandas/core/generic.py index eaf8ffeff3460..541a43d2edeff 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6653,7 +6653,7 @@ def convert_dtypes( dtypes if the floats can be faithfully casted to integers. dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` or - :class:`Series` (still experimental). Behavior is as follows: + :class:`Series` (still experimental). Behaviour is as follows: * ``"numpy_nullable"``: returns with nullable-dtype-backed * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` From f547947c367c6f316508c2cbc671ef83661d03d9 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Fri, 19 Jul 2024 12:35:37 +0800 Subject: [PATCH 08/13] add a noun --- pandas/core/dtypes/cast.py | 2 +- pandas/core/generic.py | 2 +- pandas/core/tools/numeric.py | 2 +- pandas/io/clipboards.py | 2 +- pandas/io/excel/_base.py | 4 ++-- pandas/io/feather_format.py | 2 +- pandas/io/html.py | 2 +- pandas/io/json/_json.py | 2 +- pandas/io/orc.py | 2 +- pandas/io/parquet.py | 2 +- pandas/io/parsers/readers.py | 2 +- pandas/io/spss.py | 2 +- pandas/io/sql.py | 10 +++++----- pandas/io/xml.py | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index e765cba80a593..de9cda398d9bc 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1014,7 +1014,7 @@ def convert_dtypes( Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e8cfeaabd7e57..d72a35f110102 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6672,7 +6672,7 @@ def convert_dtypes( Back-end data type applied to the resultant :class:`DataFrame` or :class:`Series` (still experimental). Behaviour is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 3d406d3bfb115..b46845ea28dba 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -96,7 +96,7 @@ def to_numeric( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index 5bf6d27e1b0ac..c7eaca1ae585a 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -44,7 +44,7 @@ def read_clipboard( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 6ff9aa11dadf8..44f8e027b4b24 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -273,7 +273,7 @@ is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -1734,7 +1734,7 @@ def parse( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 0f1d701a0783d..cf741ae40daa3 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -98,7 +98,7 @@ def read_feather( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`. * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/html.py b/pandas/io/html.py index a52ba75db491f..d4bd513e30a1b 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1137,7 +1137,7 @@ def read_html( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 732a9ba3afca7..0bc69a5e23561 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -658,7 +658,7 @@ def read_json( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/orc.py b/pandas/io/orc.py index cd8baabf8745a..6d0ec4a5eff51 100644 --- a/pandas/io/orc.py +++ b/pandas/io/orc.py @@ -67,7 +67,7 @@ def read_orc( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 3f1e1d85db548..656fed971513b 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -548,7 +548,7 @@ def read_parquet( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index f412c04f72e4a..a6bd1c1543cea 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -449,7 +449,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False): is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/spss.py b/pandas/io/spss.py index ee5ed3ca2fc16..4244b1dd95eb5 100644 --- a/pandas/io/spss.py +++ b/pandas/io/spss.py @@ -42,7 +42,7 @@ def read_spss( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 1e22322dddec3..413cd3f0c4b11 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -312,7 +312,7 @@ def read_sql_table( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -449,7 +449,7 @@ def read_sql_query( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -592,7 +592,7 @@ def read_sql( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -1689,7 +1689,7 @@ def read_table( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 @@ -2154,7 +2154,7 @@ def read_table( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 402823b6e7afb..5c053141ab3d7 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -965,7 +965,7 @@ def read_xml( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns with nullable-dtype-backed + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 From a95a01baf2c0996b84754f5d916ed36dbb6a3e65 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Tue, 6 Aug 2024 21:04:18 +0800 Subject: [PATCH 09/13] Improve --- pandas/core/dtypes/cast.py | 4 ++-- pandas/core/generic.py | 3 ++- pandas/core/tools/numeric.py | 4 ++-- pandas/io/clipboards.py | 5 ++++- pandas/io/excel/_base.py | 6 ++++-- pandas/io/feather_format.py | 3 ++- pandas/io/html.py | 3 ++- pandas/io/json/_json.py | 3 ++- pandas/io/orc.py | 3 ++- pandas/io/parquet.py | 3 ++- pandas/io/parsers/readers.py | 2 +- pandas/io/spss.py | 3 ++- pandas/io/sql.py | 15 ++++++++++----- pandas/io/xml.py | 3 ++- 14 files changed, 39 insertions(+), 21 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index c47a3dc376ed1..3bfb386cc8a27 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1014,8 +1014,8 @@ def convert_dtypes( Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"numpy_nullable"``: returns nullable-dtype + * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` .. versionadded:: 2.0 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index fca5ccbaf5200..39d0997629148 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6671,7 +6671,8 @@ def convert_dtypes( :class:`Series` (still experimental). Behaviour is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` + :class:`DataFrame` or :class:`Series`. .. versionadded:: 2.0 diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index c06c0862d6ff0..982851d0557c3 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -99,8 +99,8 @@ def to_numeric( is to not use nullable data types. If specified, the behavior is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"numpy_nullable"``: returns nullable-dtype-backed object + * ``"pyarrow"``: returns with pyarrow-backed nullable object .. versionadded:: 2.0 diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index c7eaca1ae585a..fd7d0d7fd06fe 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -45,7 +45,10 @@ def read_clipboard( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` + + .. versionadded:: 2.0 diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 44f8e027b4b24..3876a751fea9a 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -274,7 +274,8 @@ is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -1735,7 +1736,8 @@ def parse( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 **kwds : dict, optional diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 2e89109262302..694f4bed47a8b 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -99,7 +99,8 @@ def read_feather( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`. - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/html.py b/pandas/io/html.py index d4bd513e30a1b..8e9ef4ccbd802 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1138,7 +1138,8 @@ def read_html( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 0bc69a5e23561..82482bcb9339f 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -659,7 +659,8 @@ def read_json( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/orc.py b/pandas/io/orc.py index 68b3c7e8e2c31..4cf11f5375462 100644 --- a/pandas/io/orc.py +++ b/pandas/io/orc.py @@ -68,7 +68,8 @@ def read_orc( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index eb9cd4e4a691d..88af2aad62ca0 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -549,7 +549,8 @@ def read_parquet( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index c0c22a7ce446e..b77c6a1c03114 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -445,7 +445,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False): is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/spss.py b/pandas/io/spss.py index 4244b1dd95eb5..b0fb4a35d6365 100644 --- a/pandas/io/spss.py +++ b/pandas/io/spss.py @@ -43,7 +43,8 @@ def read_spss( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed + nullable :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 0dd7d4dd6754b..4243ab2b63e52 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -313,7 +313,8 @@ def read_sql_table( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -450,7 +451,8 @@ def read_sql_query( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -593,7 +595,8 @@ def read_sql( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 dtype : Type name or dict of columns @@ -1690,7 +1693,8 @@ def read_table( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -2155,7 +2159,8 @@ def read_table( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 5c053141ab3d7..608d9a812c2c0 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -966,7 +966,8 @@ def read_xml( is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - * ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype` + * ``"pyarrow"``: returns pyarrow-backed nullable + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 From 00f4f1c8b1f68964dcd99d925f22d2cbfcac3b70 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Tue, 6 Aug 2024 22:48:21 +0800 Subject: [PATCH 10/13] fix build --- pandas/core/generic.py | 2 +- pandas/io/clipboards.py | 2 +- pandas/io/excel/_base.py | 4 ++-- pandas/io/feather_format.py | 2 +- pandas/io/html.py | 2 +- pandas/io/json/_json.py | 2 +- pandas/io/orc.py | 2 +- pandas/io/parquet.py | 2 +- pandas/io/spss.py | 2 +- pandas/io/sql.py | 2 +- pandas/io/xml.py | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 39d0997629148..64eb33979d275 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6672,7 +6672,7 @@ def convert_dtypes( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - :class:`DataFrame` or :class:`Series`. + :class:`DataFrame` or :class:`Series`. .. versionadded:: 2.0 diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index fd7d0d7fd06fe..5c25fafc9ae08 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -46,7 +46,7 @@ def read_clipboard( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 3876a751fea9a..ef52107c283e9 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -275,7 +275,7 @@ * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -1737,7 +1737,7 @@ def parse( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 **kwds : dict, optional diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 694f4bed47a8b..aaae9857b4fae 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -100,7 +100,7 @@ def read_feather( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`. * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/html.py b/pandas/io/html.py index 8e9ef4ccbd802..c9897f628fdc9 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1139,7 +1139,7 @@ def read_html( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 82482bcb9339f..d077b9e0c4568 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -660,7 +660,7 @@ def read_json( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/orc.py b/pandas/io/orc.py index 4cf11f5375462..f179dafc919e5 100644 --- a/pandas/io/orc.py +++ b/pandas/io/orc.py @@ -69,7 +69,7 @@ def read_orc( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 88af2aad62ca0..24415299e799b 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -550,7 +550,7 @@ def read_parquet( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/spss.py b/pandas/io/spss.py index b0fb4a35d6365..e597463aee453 100644 --- a/pandas/io/spss.py +++ b/pandas/io/spss.py @@ -44,7 +44,7 @@ def read_spss( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed - nullable :class:`ArrowDtype` :class:`DataFrame` + nullable :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 4243ab2b63e52..dc9f3fb0855da 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -314,7 +314,7 @@ def read_sql_table( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 608d9a812c2c0..0fcf27af42fde 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -967,7 +967,7 @@ def read_xml( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 From b7b1e8c74130ee60e11e0da19dc595a016478ff6 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Tue, 6 Aug 2024 22:55:17 +0800 Subject: [PATCH 11/13] fix build --- pandas/io/sql.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index dc9f3fb0855da..99dd06568fa01 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -452,7 +452,7 @@ def read_sql_query( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -596,7 +596,7 @@ def read_sql( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 dtype : Type name or dict of columns @@ -1694,7 +1694,7 @@ def read_table( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 @@ -2160,7 +2160,7 @@ def read_table( * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` * ``"pyarrow"``: returns pyarrow-backed nullable - :class:`ArrowDtype` :class:`DataFrame` + :class:`ArrowDtype` :class:`DataFrame` .. versionadded:: 2.0 From 0de0ca6c42fddb6ced8003708054059b3b1c8d19 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Fri, 9 Aug 2024 19:11:51 +0800 Subject: [PATCH 12/13] fix build --- pandas/io/clipboards.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index 5c25fafc9ae08..2ed241f0b9bca 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -48,8 +48,6 @@ def read_clipboard( * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` :class:`DataFrame` - - .. versionadded:: 2.0 **kwargs From 53423be8c1ae2287e1921a1792808b91ea47f236 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Fri, 9 Aug 2024 19:11:51 +0800 Subject: [PATCH 13/13] fix build fix review --- pandas/core/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 64eb33979d275..a585a967ab616 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6670,7 +6670,8 @@ def convert_dtypes( Back-end data type applied to the resultant :class:`DataFrame` or :class:`Series` (still experimental). Behaviour is as follows: - * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` + * ``"numpy_nullable"``: returns nullable-dtype-backed + :class:`DataFrame` or :class:`Serires`. * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` :class:`DataFrame` or :class:`Series`.