Skip to content

CLN: remove unnecessary to_dense call #32533

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 1 commit into from
Mar 10, 2020

Conversation

jbrockmendel
Copy link
Member

This call is not reached in the tests, and if it were the following line would make it superfluous anyway.

I'm pretty sure the comment there is wrong too.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@WillAyd WillAyd added the Clean label Mar 9, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Mar 10, 2020
@simonjayhawkins
Copy link
Member

This call is not reached in the tests

CategoricalArray and SparseArray have a to_dense methods and therefore hasattr(values, "to_dense") would be True.

However, format_array would use ExtensionArrayFormatter and not FloatArrayFormatter for these so hasattr(values, "to_dense") should always be False in FloatArrayFormatter.

ExtensionArrayFormatter dispatches back to format_array with a numpy array.

@simonjayhawkins simonjayhawkins merged commit 113c255 into pandas-dev:master Mar 10, 2020
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the no-to_dense branch March 10, 2020 14:54
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants