-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Create empty dataframe with string dtype fails #33651
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
Changes from 3 commits
82dc446
d1da8c8
66eda6a
ff26d95
92d75b7
0363ef0
5fcfed6
5ad5f8b
9e15301
e8e1ed1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,11 @@ def dtype(request): | |
return request.param() | ||
|
||
|
||
@pytest.fixture | ||
def columns(): | ||
return integer_array(make_data()) | ||
|
||
|
||
@pytest.fixture | ||
def data(dtype): | ||
return integer_array(make_data(), dtype=dtype) | ||
|
@@ -186,7 +191,9 @@ class TestInterface(base.BaseInterfaceTests): | |
|
||
|
||
class TestConstructors(base.BaseConstructorsTests): | ||
pass | ||
@pytest.mark.xfail(reason="bad is-na for empty data") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this xfailed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we would fix this here. What needs to change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to allows values.ndim to be 0 in coerce_to_array(). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we instead not pass a 0-dim array to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added processing to convert np.nan to [].
|
||
def test_construct_empty_dataframe(self, columns, dtyoe): | ||
super().test_construct_empty_dataframe(columns, dtype) | ||
|
||
|
||
class TestReshaping(base.BaseReshapingTests): | ||
|
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.
this will be
dtype.na_value
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 update this
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.
Sorry, I can't figure out how to fix this from "this will be dtype.na_value".
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.
nan_dtype = dtype.na_value
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.
will change to
nan_dtype = dtype.na_value
, error occurs.So I updated it like this.