We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69ef543 commit 29fdc69Copy full SHA for 29fdc69
pandas/core/arrays/sparse/dtype.py
@@ -1,7 +1,7 @@
1
"""Sparse Dtype"""
2
3
import re
4
-from typing import Any
+from typing import Any, Tuple
5
6
import numpy as np
7
@@ -223,7 +223,7 @@ def construct_from_string(cls, string):
223
raise TypeError(msg)
224
225
@staticmethod
226
- def _parse_subtype(dtype):
+ def _parse_subtype(dtype: str) -> Tuple[str, bool]:
227
"""
228
Parse a string to get the subtype
229
@@ -249,7 +249,7 @@ def _parse_subtype(dtype):
249
has_fill_value = False
250
if m:
251
subtype = m.groupdict()["subtype"]
252
- has_fill_value = m.groupdict()["fill_value"] or has_fill_value
+ has_fill_value = bool(m.groupdict()["fill_value"])
253
elif dtype == "Sparse":
254
subtype = "float64"
255
else:
0 commit comments