-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Appending empty list to DataFrame #28769 #28834
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
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.
from the docs..
other : DataFrame or Series/dict-like object, or list of these
The data to append.
shouldn't passing an empty list raise an Exception. but perhaps with a more user friendly message.
Co-Authored-By: Simon Hawkins <[email protected]>
@simonjayhawkins |
I'm not sure. see what others think. not raising on an empty list is perhaps more pythonic, but without checking, I'm not sure how we handle this scenario in other methods. It maybe worth adding type annotations to |
@@ -129,6 +129,17 @@ def test_concat_tuple_keys(self): | |||
) | |||
assert_frame_equal(results, expected) | |||
|
|||
def test_append_empty_list(self): |
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.
can you parameterize with empty list, tuple, np.ndarray
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.
@jreback Please see the reply in the other comment (#28834 (comment))
can you merge master |
Rebased master. I'm not sure if there's an issue with the CI or if I messed something up |
I see this in the Travis logs
|
thanks @asishm |
That would be quite special behavior:
empty lists, strings, etc should be neutral in operations instead of causing errors. That saves an unecessary if check for a corner case. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff