-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
TST: Get tests to run and fix them to pass #50636
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 2 commits
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ def construct(box, shape, value=None, dtype=None, **kwargs): | |
return box(arr, dtype=dtype, **kwargs) | ||
|
||
|
||
class Generic: | ||
class TestGeneric: | ||
@pytest.mark.parametrize( | ||
"func", | ||
[ | ||
|
@@ -66,7 +66,7 @@ def test_rename(self, frame_or_series, func): | |
|
||
for axis in frame_or_series._AXIS_ORDERS: | ||
kwargs = {axis: idx} | ||
obj = construct(4, **kwargs) | ||
obj = construct(frame_or_series, 4, **kwargs) | ||
|
||
# rename a single axis | ||
result = obj.rename(**{axis: func}) | ||
|
@@ -83,21 +83,21 @@ def test_get_numeric_data(self, frame_or_series): | |
} | ||
|
||
# get the numeric data | ||
o = construct(n, **kwargs) | ||
o = construct(frame_or_series, n, **kwargs) | ||
result = o._get_numeric_data() | ||
tm.assert_equal(result, o) | ||
|
||
# non-inclusion | ||
result = o._get_bool_data() | ||
expected = construct(n, value="empty", **kwargs) | ||
expected = construct(frame_or_series, n, value="empty", **kwargs) | ||
if isinstance(o, DataFrame): | ||
# preserve columns dtype | ||
expected.columns = o.columns[:0] | ||
tm.assert_equal(result, expected) | ||
tm.assert_equal(result.reset_index(drop=True), expected) | ||
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. @topper-123 is this right? In [1]: ser = Series([1,2,3])
In [2]: ser.index
Out[2]: RangeIndex(start=0, stop=3, step=1)
In [3]: ser._get_bool_data()
Out[3]: Series([], dtype: int64)
In [4]: ser._get_bool_data().index
Out[4]: Index([], dtype='object') 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. @phershbe OK for now could you please just add a comment with
above this line? then we can get this in and address that separately if needed |
||
|
||
# get the bool data | ||
arr = np.array([True, True, False, True]) | ||
o = construct(n, value=arr, **kwargs) | ||
o = construct(frame_or_series, n, value=arr, **kwargs) | ||
result = o._get_numeric_data() | ||
tm.assert_equal(result, o) | ||
|
||
|
@@ -160,7 +160,7 @@ def f(dtype): | |
|
||
msg = ( | ||
"compound dtypes are not implemented " | ||
f"in the {frame_or_series.__name__} frame_or_series" | ||
f"in the {frame_or_series.__name__} constructor" | ||
) | ||
|
||
with pytest.raises(NotImplementedError, match=msg): | ||
|
@@ -257,7 +257,7 @@ def test_api_compat(self, func, frame_or_series): | |
# GH 12021 | ||
# compat for __name__, __qualname__ | ||
|
||
obj = (frame_or_series, 5) | ||
obj = construct(frame_or_series, 5) | ||
f = getattr(obj, func) | ||
assert f.__name__ == func | ||
assert f.__qualname__.endswith(func) | ||
|
Uh oh!
There was an error while loading. Please reload this page.