Skip to content

Commit c5d9c08

Browse files
authored
Allow pd.StringDtype's optional arg (#535)
Fixed pd.StringDtype's optional arg with test case
1 parent b76dbb6 commit c5d9c08

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pandas-stubs/core/arrays/string_.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from pandas._libs.missing import NAType
77
from pandas.core.dtypes.base import ExtensionDtype
88

99
class StringDtype(ExtensionDtype):
10-
def __init__(self, storage: Literal["python", "pyarrow"] | None) -> None: ...
10+
def __init__(self, storage: Literal["python", "pyarrow"] | None = None) -> None: ...
1111
@property
1212
def na_value(self) -> NAType: ...
1313

tests/test_dtypes.py

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def test_sparse_dtype() -> None:
126126

127127
def test_string_dtype() -> None:
128128
s_dt = pd.StringDtype("pyarrow")
129+
check(assert_type(pd.StringDtype(), pd.StringDtype), pd.StringDtype)
129130
check(assert_type(pd.StringDtype("pyarrow"), pd.StringDtype), pd.StringDtype)
130131
check(assert_type(pd.StringDtype("python"), pd.StringDtype), pd.StringDtype)
131132
check(assert_type(s_dt.na_value, NAType), NAType)

0 commit comments

Comments
 (0)