File tree 1 file changed +3
-3
lines changed
pandas/core/arrays/sparse
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
"""Sparse Dtype"""
2
2
3
3
import re
4
- from typing import Any
4
+ from typing import Any , Tuple , Union
5
5
6
6
import numpy as np
7
7
@@ -223,7 +223,7 @@ def construct_from_string(cls, string):
223
223
raise TypeError (msg )
224
224
225
225
@staticmethod
226
- def _parse_subtype (dtype ):
226
+ def _parse_subtype (dtype ) -> Tuple [ str , Union [ str , bool ]] :
227
227
"""
228
228
Parse a string to get the subtype
229
229
@@ -246,7 +246,7 @@ def _parse_subtype(dtype):
246
246
"""
247
247
xpr = re .compile (r"Sparse\[(?P<subtype>[^,]*)(, )?(?P<fill_value>.*?)?\]$" )
248
248
m = xpr .match (dtype )
249
- has_fill_value = False
249
+ has_fill_value : Union [ str , bool ] = False
250
250
if m :
251
251
subtype = m .groupdict ()["subtype" ]
252
252
has_fill_value = m .groupdict ()["fill_value" ] or has_fill_value
You can’t perform that action at this time.
0 commit comments