Skip to content

Commit 2071b6c

Browse files
twoertweinyehoshuadimarsky
authored andcommitted
TYP: StorageExtensionDtype.na_values (pandas-dev#47300)
* TYP: StorageExtensionDtype.na_values * flake8
1 parent d2e1a71 commit 2071b6c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pandas/core/arrays/arrow/dtype.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import numpy as np
66
import pyarrow as pa
77

8-
from pandas._libs import missing as libmissing
98
from pandas._typing import DtypeObj
109
from pandas.util._decorators import cache_readonly
1110

@@ -22,7 +21,6 @@ class ArrowDtype(StorageExtensionDtype):
2221
Modeled after BaseMaskedDtype
2322
"""
2423

25-
na_value = libmissing.NA
2624
_metadata = ("storage", "pyarrow_dtype") # type: ignore[assignment]
2725

2826
def __init__(self, pyarrow_dtype: pa.DataType) -> None:

pandas/core/dtypes/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ class StorageExtensionDtype(ExtensionDtype):
395395
"""ExtensionDtype that may be backed by more than one implementation."""
396396

397397
name: str
398-
na_value = libmissing.NA
399398
_metadata = ("storage",)
400399

401400
def __init__(self, storage=None) -> None:
@@ -416,6 +415,10 @@ def __hash__(self) -> int:
416415
# custom __eq__ so have to override __hash__
417416
return super().__hash__()
418417

418+
@property
419+
def na_value(self) -> libmissing.NAType:
420+
return libmissing.NA
421+
419422

420423
def register_extension_dtype(cls: type_t[ExtensionDtypeT]) -> type_t[ExtensionDtypeT]:
421424
"""

pyright_reportGeneralTypeIssues.json

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"pandas/core/computation/align.py",
4040
"pandas/core/construction.py",
4141
"pandas/core/describe.py",
42-
"pandas/core/dtypes/base.py",
4342
"pandas/core/dtypes/cast.py",
4443
"pandas/core/dtypes/common.py",
4544
"pandas/core/dtypes/concat.py",

0 commit comments

Comments
 (0)