Skip to content

BUG: Fix alignment of list-like objects for operations with DataFrame #17926

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
Oct 20, 2017

Conversation

jschendel
Copy link
Member

Some comments:

  • Replaced pd.DataFrame with ABCDataFrame in isinstance checks throughout ops.py, as I'm of the impression that this is the best practice. Can revert these if I'm mistaken.
  • I didn't use deque in the test I modified (though I did in the one I created). The reason being that deque gets cast to int32 instead of int64 on Windows, and the test compares against a Series with int64 dtype.
    • Could be fixed by mimicking the is_list_like check here, and doing something similar to BUG: Fix range dtype in Series/DataFrame constructor on Windows #17840 but probably best to do in a separate PR (would be happy to do such a PR)
    • I could explicitly cast the result series to int64 if we want to add deque now, then remove after implementing a fix
    • I suppose it could be marked as xfailing if without modifications if we want to add deque now, but seems kind of pointless to mark one of the tests being modified as xfailing

@codecov
Copy link

codecov bot commented Oct 20, 2017

Codecov Report

Merging #17926 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17926      +/-   ##
==========================================
- Coverage   91.23%   91.22%   -0.02%     
==========================================
  Files         163      163              
  Lines       50112    50113       +1     
==========================================
- Hits        45722    45714       -8     
- Misses       4390     4399       +9
Flag Coverage Δ
#multiple 89.03% <100%> (ø) ⬆️
#single 40.31% <70%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/ops.py 91.77% <100%> (+0.01%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.75% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51c5f4d...782eddc. Read the comment docs.

@jreback jreback added Bug Numeric Operations Arithmetic, Comparison, and Logical operations labels Oct 20, 2017
@jreback jreback added this to the 0.21.0 milestone Oct 20, 2017
@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label Oct 20, 2017
@jreback jreback merged commit cd477c8 into pandas-dev:master Oct 20, 2017
@jreback
Copy link
Contributor

jreback commented Oct 20, 2017

thanks @jschendel nice fix!

I didn't use deque in the test I modified (though I did in the one I created). The reason being that deque gets cast to int32 instead of int64 on Windows, and the test compares against a Series with int64 dtype.

FYI you can construct using np.arange() which is platform dependent.

yeemey pushed a commit to yeemey/pandas that referenced this pull request Oct 20, 2017
@jschendel jschendel deleted the fix-list-like-orientation branch October 22, 2017 05:46
alanbato pushed a commit to alanbato/pandas that referenced this pull request Nov 10, 2017
No-Stream pushed a commit to No-Stream/pandas that referenced this pull request Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong orientation of operations between DataFrame and range()
2 participants