Skip to content
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
12 changes: 10 additions & 2 deletions pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def load_reduce(self):

class _LoadSparseSeries:
# To load a SparseSeries as a Series[Sparse]
def __new__(cls) -> "Series":

# https://github.com/python/mypy/issues/1020
# error: Incompatible return type for "__new__" (returns "Series", but must return
# a subtype of "_LoadSparseSeries")
def __new__(cls) -> "Series": # type: ignore
from pandas import Series

warnings.warn(
Expand All @@ -82,7 +86,11 @@ def __new__(cls) -> "Series":

class _LoadSparseFrame:
# To load a SparseDataFrame as a DataFrame[Sparse]
def __new__(cls) -> "DataFrame":

# https://github.com/python/mypy/issues/1020
# error: Incompatible return type for "__new__" (returns "DataFrame", but must
# return a subtype of "_LoadSparseFrame")
def __new__(cls) -> "DataFrame": # type: ignore
from pandas import DataFrame

warnings.warn(
Expand Down