Skip to content

Commit fad9ace

Browse files
mypy fix-up following pandas-dev#28516
1 parent f610ce3 commit fad9ace

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, Union
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) -> Tuple[str, Union[str, bool]]:
227227
"""
228228
Parse a string to get the subtype
229229
@@ -246,7 +246,7 @@ def _parse_subtype(dtype):
246246
"""
247247
xpr = re.compile(r"Sparse\[(?P<subtype>[^,]*)(, )?(?P<fill_value>.*?)?\]$")
248248
m = xpr.match(dtype)
249-
has_fill_value = False
249+
has_fill_value: Union[str, bool] = False
250250
if m:
251251
subtype = m.groupdict()["subtype"]
252252
has_fill_value = m.groupdict()["fill_value"] or has_fill_value

0 commit comments

Comments
 (0)