Skip to content

Commit 29fdc69

Browse files
simonjayhawkinsWillAyd
authored andcommitted
TYP: some types for pandas/core/arrays/sparse/dtype.py (#29899)
1 parent 69ef543 commit 29fdc69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/arrays/sparse/dtype.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sparse Dtype"""
22

33
import re
4-
from typing import Any
4+
from typing import Any, Tuple
55

66
import numpy as np
77

@@ -223,7 +223,7 @@ def construct_from_string(cls, string):
223223
raise TypeError(msg)
224224

225225
@staticmethod
226-
def _parse_subtype(dtype):
226+
def _parse_subtype(dtype: str) -> Tuple[str, bool]:
227227
"""
228228
Parse a string to get the subtype
229229
@@ -249,7 +249,7 @@ def _parse_subtype(dtype):
249249
has_fill_value = False
250250
if m:
251251
subtype = m.groupdict()["subtype"]
252-
has_fill_value = m.groupdict()["fill_value"] or has_fill_value
252+
has_fill_value = bool(m.groupdict()["fill_value"])
253253
elif dtype == "Sparse":
254254
subtype = "float64"
255255
else:

0 commit comments

Comments
 (0)