Skip to content

Commit

Permalink
remove unused kwarg (#24695)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and jreback committed Jan 10, 2019
1 parent 021cbae commit 4bd286a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def astype(self, dtype, copy=False, errors='raise', values=None, **kwargs):
**kwargs)

def _astype(self, dtype, copy=False, errors='raise', values=None,
klass=None, **kwargs):
**kwargs):
"""Coerce to the new type
Parameters
Expand Down Expand Up @@ -599,14 +599,14 @@ def _astype(self, dtype, copy=False, errors='raise', values=None,
return self.copy()
return self

if klass is None:
if is_sparse(self.values):
# special case sparse, Series[Sparse].astype(object) is sparse
klass = ExtensionBlock
elif is_object_dtype(dtype):
klass = ObjectBlock
elif is_extension_array_dtype(dtype):
klass = ExtensionBlock
klass = None
if is_sparse(self.values):
# special case sparse, Series[Sparse].astype(object) is sparse
klass = ExtensionBlock
elif is_object_dtype(dtype):
klass = ObjectBlock
elif is_extension_array_dtype(dtype):
klass = ExtensionBlock

try:
# force the copy here
Expand Down

0 comments on commit 4bd286a

Please sign in to comment.