|
9 | 9 | Any, |
10 | 10 | Literal, |
11 | 11 | ) |
12 | | -import warnings |
13 | 12 | from warnings import catch_warnings |
14 | 13 |
|
15 | 14 | from pandas._config import using_pyarrow_string_dtype |
|
18 | 17 | from pandas.compat._optional import import_optional_dependency |
19 | 18 | from pandas.errors import AbstractMethodError |
20 | 19 | from pandas.util._decorators import doc |
21 | | -from pandas.util._exceptions import find_stack_level |
22 | 20 | from pandas.util._validators import check_dtype_backend |
23 | 21 |
|
24 | 22 | import pandas as pd |
@@ -240,7 +238,6 @@ def read( |
240 | 238 | path, |
241 | 239 | columns=None, |
242 | 240 | filters=None, |
243 | | - use_nullable_dtypes: bool = False, |
244 | 241 | dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default, |
245 | 242 | storage_options: StorageOptions | None = None, |
246 | 243 | filesystem=None, |
@@ -357,15 +354,9 @@ def read( |
357 | 354 | **kwargs, |
358 | 355 | ) -> DataFrame: |
359 | 356 | parquet_kwargs: dict[str, Any] = {} |
360 | | - use_nullable_dtypes = kwargs.pop("use_nullable_dtypes", False) |
361 | 357 | dtype_backend = kwargs.pop("dtype_backend", lib.no_default) |
362 | 358 | # We are disabling nullable dtypes for fastparquet pending discussion |
363 | 359 | parquet_kwargs["pandas_nulls"] = False |
364 | | - if use_nullable_dtypes: |
365 | | - raise ValueError( |
366 | | - "The 'use_nullable_dtypes' argument is not supported for the " |
367 | | - "fastparquet engine" |
368 | | - ) |
369 | 360 | if dtype_backend is not lib.no_default: |
370 | 361 | raise ValueError( |
371 | 362 | "The 'dtype_backend' argument is not supported for the " |
@@ -493,7 +484,6 @@ def read_parquet( |
493 | 484 | engine: str = "auto", |
494 | 485 | columns: list[str] | None = None, |
495 | 486 | storage_options: StorageOptions | None = None, |
496 | | - use_nullable_dtypes: bool | lib.NoDefault = lib.no_default, |
497 | 487 | dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default, |
498 | 488 | filesystem: Any = None, |
499 | 489 | filters: list[tuple] | list[list[tuple]] | None = None, |
@@ -534,17 +524,6 @@ def read_parquet( |
534 | 524 |
|
535 | 525 | .. versionadded:: 1.3.0 |
536 | 526 |
|
537 | | - use_nullable_dtypes : bool, default False |
538 | | - If True, use dtypes that use ``pd.NA`` as missing value indicator |
539 | | - for the resulting DataFrame. (only applicable for the ``pyarrow`` |
540 | | - engine) |
541 | | - As new dtypes are added that support ``pd.NA`` in the future, the |
542 | | - output with this option will change to use those dtypes. |
543 | | - Note: this is an experimental option, and behaviour (e.g. additional |
544 | | - support dtypes) may change without notice. |
545 | | -
|
546 | | - .. deprecated:: 2.0 |
547 | | -
|
548 | 527 | dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' |
549 | 528 | Back-end data type applied to the resultant :class:`DataFrame` |
550 | 529 | (still experimental). Behaviour is as follows: |
@@ -643,27 +622,13 @@ def read_parquet( |
643 | 622 | """ |
644 | 623 |
|
645 | 624 | impl = get_engine(engine) |
646 | | - |
647 | | - if use_nullable_dtypes is not lib.no_default: |
648 | | - msg = ( |
649 | | - "The argument 'use_nullable_dtypes' is deprecated and will be removed " |
650 | | - "in a future version." |
651 | | - ) |
652 | | - if use_nullable_dtypes is True: |
653 | | - msg += ( |
654 | | - "Use dtype_backend='numpy_nullable' instead of use_nullable_dtype=True." |
655 | | - ) |
656 | | - warnings.warn(msg, FutureWarning, stacklevel=find_stack_level()) |
657 | | - else: |
658 | | - use_nullable_dtypes = False |
659 | 625 | check_dtype_backend(dtype_backend) |
660 | 626 |
|
661 | 627 | return impl.read( |
662 | 628 | path, |
663 | 629 | columns=columns, |
664 | 630 | filters=filters, |
665 | 631 | storage_options=storage_options, |
666 | | - use_nullable_dtypes=use_nullable_dtypes, |
667 | 632 | dtype_backend=dtype_backend, |
668 | 633 | filesystem=filesystem, |
669 | 634 | **kwargs, |
|
0 commit comments