Skip to content

[ArrayManager] TST: include subset of ArrayManager tests in all CI builds #40496

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 13 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ fi

echo $PYTEST_CMD
sh -c "$PYTEST_CMD"

PYTEST_AM_CMD="PANDAS_DATA_MANAGER=array pytest -m \"$PATTERN and arraymanager\" -n $PYTEST_WORKERS --dist=loadfile -s --strict-markers --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

echo $PYTEST_AM_CMD
sh -c "$PYTEST_AM_CMD"
10 changes: 10 additions & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def pytest_configure(config):
config.addinivalue_line(
"markers", "arm_slow: mark a test as slow for arm64 architecture"
)
config.addinivalue_line(
"markers", "arraymanager: mark a test to run with ArrayManager enabled"
)


def pytest_addoption(parser):
Expand Down Expand Up @@ -121,6 +124,13 @@ def pytest_runtest_setup(item):
pytest.skip("skipping high memory test since --run-high-memory was not set")


def pytest_collection_modifyitems(items):
for item in items:
# mark all tests in the pandas/tests/frame directory with "arraymanager"
if "/frame/" in item.nodeid:
item.add_marker(pytest.mark.arraymanager)


# Hypothesis
hypothesis.settings.register_profile(
"ci",
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/frame/indexing/test_setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,9 @@ def test_setitem_duplicate_columns_not_inplace(self):
tm.assert_frame_equal(df_view, df_copy)
tm.assert_frame_equal(df, expected)

@pytest.mark.parametrize("value", [1, np.array([[1], [1]]), [[1], [1]]])
@pytest.mark.parametrize(
"value", [1, np.array([[1], [1]], dtype="int64"), [[1], [1]]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

this is causing me problems in #35417 and i thinking making this change would fix that, but would feel like cheating

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just adding a fixed dtype, doesn't change anything else. The default dtype of numpy is platform dependent, while in pandas it's always int64 (as you know ;))

)
def test_setitem_same_dtype_not_inplace(self, value, using_array_manager, request):
# GH#39510
if not using_array_manager:
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/frame/test_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def kurt(x):
pass

# TODO: Ensure warning isn't emitted in the first place
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
# ignore mean of empty slice and all-NaN
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
def test_median(self, float_frame_with_na, int_frame):
def wrapper(x):
if isna(x).any():
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_stack_unstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def test_unstack_nan_index3(self, using_array_manager):
if using_array_manager:
# INFO(ArrayManager) with ArrayManager preserve dtype where possible
cols = right.columns[[1, 2, 3, 5]]
right[cols] = right[cols].astype("int64")
right[cols] = right[cols].astype(df["C"].dtype)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i take it this is a 32bit thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was to fix the windows builds

tm.assert_frame_equal(left, right)

def test_unstack_nan_index4(self):
Expand Down