Skip to content

REF: use extract_array in DataFrame.combine_first #37731

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 3 commits into from
Nov 11, 2020

Conversation

arw2019
Copy link
Member

@arw2019 arw2019 commented Nov 10, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@jreback jreback added the Refactor Internal refactoring of code label Nov 10, 2020
@jreback jreback added this to the 1.2 milestone Nov 10, 2020
@jreback
Copy link
Contributor

jreback commented Nov 10, 2020

lgtm cc @jbrockmendel

@jbrockmendel
Copy link
Member

the extract_array part looks good, but not clear why the needs_i8_conversion part can be removed safely

x_values = extract_values(x)
y_values = extract_values(y)
x_values = extract_array(x)
y_values = extract_array(y)
Copy link
Member

Choose a reason for hiding this comment

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

i guess pass extract_numpy=True on these

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@arw2019 arw2019 changed the title [WIP] CLN: use extract_array in DataFrame.combine_first CLN: use extract_array in DataFrame.combine_first Nov 10, 2020
@arw2019
Copy link
Member Author

arw2019 commented Nov 10, 2020

the extract_array part looks good, but not clear why the needs_i8_conversion part can be removed safely

I reverted it

Although CI is not passing without for lack of testing with datelike input - AFAICT we have good (but maybe not water-tight) coverage there

@jbrockmendel
Copy link
Member

Although CI is not passing without for lack of testing with datelike input - AFAICT we have good (but maybe not water-tight) coverage there

it may be unnecessary (in fact i hope it is), just want to have an idea why its unnecessary (or at least make sure we have relevant test coverage)

@arw2019
Copy link
Member Author

arw2019 commented Nov 10, 2020

Although CI is not passing without for lack of testing with datelike input - AFAICT we have good (but maybe not water-tight) coverage there

it may be unnecessary (in fact i hope it is), just want to have an idea why its unnecessary (or at least make sure we have relevant test coverage)

Ok! Checked that both parts of the if/else clause inside if needs_i8_conversion(arr.dtype) are hit in:

pandas/tests/frame/methods/test_combine_first.py::TestDataFrameCombineFirst::test_combine_first_timezone
pandas/tests/frame/methods/test_combine_first.py::TestDataFrameCombineFirst::test_combine_first_period

@arw2019 arw2019 force-pushed the clean-df-combine-first branch from dc20092 to 63a54a0 Compare November 10, 2020 05:31
@arw2019 arw2019 changed the title CLN: use extract_array in DataFrame.combine_first REF: use extract_array in DataFrame.combine_first Nov 10, 2020
@jreback jreback merged commit e480a44 into pandas-dev:master Nov 11, 2020
@jreback
Copy link
Contributor

jreback commented Nov 11, 2020

thanks @arw2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants