-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
MAINT: Drop convert_objects from NDFrame #15757
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -768,7 +768,7 @@ def _is_empty_indexer(indexer): | |
values = self._try_coerce_and_cast_result(values, dtype) | ||
block = self.make_block(transf(values), fastpath=True) | ||
|
||
# may have to soft convert_objects here | ||
# May have to soft convert objects here | ||
if block.is_object and not self.is_object: | ||
block = block.convert(numeric=False) | ||
|
||
|
@@ -1850,12 +1850,13 @@ def is_bool(self): | |
""" | ||
return lib.is_bool_array(self.values.ravel()) | ||
|
||
# TODO: Refactor when convert_objects is removed since there will be 1 path | ||
def convert(self, *args, **kwargs): | ||
""" attempt to coerce any object types to better types return a copy of | ||
the block (if copy = True) by definition we ARE an ObjectBlock!!!!! | ||
""" | ||
Attempt to coerce any object types to more specific data types. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's a whole bunch of code here that i think u can ditch now that was for compat with convert_objects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by compat with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. most of this code iirc was to support multiple convert args at the same time (via convert_objects) which is not needed by convert - look at the blame and u shall see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really follow you here. |
||
If copy = True, return a copy of the block. | ||
|
||
can return multiple blocks! | ||
NOTE: This function can can return multiple blocks! | ||
NOTE: By definition, we are an ObjectBlock! | ||
""" | ||
|
||
if args: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look and see when this comment was put in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of the fn_kwargs stuff can go back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be removed i mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did. #11173 - I'm not sure I follow what the logic was back then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
fn_kwargs
?convert
appears to be just a wrapper around all of the object conversion functions as I mentioned above. Doesn't that allow us to pass in keyword arguments specific to each of those functions?