Skip to content

TYP: some types for pandas/core/arrays/sparse/dtype.py #29899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/arrays/sparse/dtype.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Sparse Dtype"""

import re
from typing import Any
from typing import Any, Tuple

import numpy as np

Expand Down Expand Up @@ -223,7 +223,7 @@ def construct_from_string(cls, string):
raise TypeError(msg)

@staticmethod
def _parse_subtype(dtype):
def _parse_subtype(dtype: str) -> Tuple[str, bool]:
"""
Parse a string to get the subtype

Expand All @@ -249,7 +249,7 @@ def _parse_subtype(dtype):
has_fill_value = False
if m:
subtype = m.groupdict()["subtype"]
has_fill_value = m.groupdict()["fill_value"] or has_fill_value
has_fill_value = bool(m.groupdict()["fill_value"])
elif dtype == "Sparse":
subtype = "float64"
else:
Expand Down