-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Adding empty dataframes should result in empty blocks #10181 #10188
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
Conversation
@@ -5129,6 +5129,11 @@ def test_operators(self): | |||
df = DataFrame({'a': ['a', None, 'b']}) | |||
assert_frame_equal(df + df, DataFrame({'a': ['aa', np.nan, 'bb']})) | |||
|
|||
df = DataFrame() | |||
self.assertTrue((df + df).equals(DataFrame())) |
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.
pls add the issue number as a comment.
I would also add a couple of other test, things like
df = DataFrame(columns=['A'])
self.assertTrue((df+df).equals(df)
- add for an index, but no columns
- same as above, but specify a
dtype='int64'
Added more tests and comment as suggested |
325e5ad
to
7f2b9ac
Compare
@rekcahpassyla ok this looks reasonable. pls add a release note to whatsnew/v0.17.0 (you can put in other API changes section). pls squash as well. |
7f2b9ac
to
9294f92
Compare
Added release note and squashed. |
I note the build failure, will have a look. |
I have verified that my latest commit passes the |
e4188a0
to
9294f92
Compare
Raised #10195 and proposed #10196 to fix the issue causing https://travis-ci.org/pydata/pandas/builds/63544612 to fail. |
pls rebase this (and move the release note to 0.16.2) |
5aaed1d
to
4f1e43d
Compare
I think these are some old travis failures. can you rebase on master. ping when green. |
4f1e43d
to
d0ba41e
Compare
@jreback - It is green |
BUG: Adding empty dataframes should result in empty blocks #10181
thanks! |
Fixes #10181
I added a couple of lines to the dataframe test
test_operators
to assert that adding two empty dataframes returns a dataframe that is equal (both usingassert_frame_equal
as well as.equals
) to an empty dataframe.I couldn't get vbench to install (I am running on windows) - the error was:
The test suite failed for me in master with 1 failure. The same failure, but no others, were observed when running in my branch.