Skip to content

Commit

Permalink
Propagate failures in pandas integration tests and Skip failing tests (
Browse files Browse the repository at this point in the history
…#17521)

This PR ensures that the integration tests fail in any one of the test modules fails. It also skips of xfails any tests that are not currently passing. Finally, it fixes one incorrect use of `rng.random`.

Some of the change were originally made in  #17489

Authors:
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #17521
  • Loading branch information
Matt711 authored Dec 13, 2024
1 parent 7749702 commit 5baaf6d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 150 deletions.
16 changes: 11 additions & 5 deletions ci/cudf_pandas_scripts/third-party-integration/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ main() {
LIBS=${LIBS#[}
LIBS=${LIBS%]}

ANY_FAILURES=0

for lib in ${LIBS//,/ }; do
lib=$(echo "$lib" | tr -d '""')
echo "Running tests for library $lib"
Expand Down Expand Up @@ -56,10 +58,6 @@ main() {
rapids-logger "Check GPU usage"
nvidia-smi

EXITCODE=0
trap "EXITCODE=1" ERR
set +e

rapids-logger "pytest ${lib}"

NUM_PROCESSES=8
Expand All @@ -72,12 +70,20 @@ main() {
fi
done

EXITCODE=0
trap "EXITCODE=1" ERR
set +e

TEST_DIR=${TEST_DIR} NUM_PROCESSES=${NUM_PROCESSES} ci/cudf_pandas_scripts/third-party-integration/run-library-tests.sh ${lib}

set -e
rapids-logger "Test script exiting with value: ${EXITCODE}"
if [[ ${EXITCODE} != 0 ]]; then
ANY_FAILURES=1
fi
done

exit ${EXITCODE}
exit ${ANY_FAILURES}
}

main "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ files:
- py_version
- test_base
- test_xgboost
test_catboost:
output: none
includes:
- cuda_version
- py_version
- test_base
- test_catboost
test_cuml:
output: none
includes:
Expand Down Expand Up @@ -251,14 +244,6 @@ dependencies:
- pip
- pip:
- xgboost>=2.0.1
test_catboost:
common:
- output_types: conda
packages:
- numpy
- scipy
- scikit-learn
- catboost
test_cuml:
common:
- output_types: conda
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def test_holoviews_heatmap(df):
)


@pytest.mark.skip(
reason="AttributeError: 'ndarray' object has no attribute '_fsproxy_wrapped'"
)
def test_holoviews_histogram(df):
return get_plot_info(hv.Histogram(df.values))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ def assert_plots_equal(expect, got):
pytestmark = pytest.mark.assert_eq(fn=assert_plots_equal)


@pytest.mark.skip(
reason="AttributeError: 'ndarray' object has no attribute '_fsproxy_wrapped'"
)
def test_line():
df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [2, 4, 6, 8, 10]})
(data,) = plt.plot(df["x"], df["y"], marker="o", linestyle="-")

return plt.gca()


@pytest.mark.skip(
reason="AttributeError: 'ndarray' object has no attribute '_fsproxy_wrapped'"
)
def test_bar():
data = pd.Series([1, 2, 3, 4, 5], index=["a", "b", "c", "d", "e"])
ax = data.plot(kind="bar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def test_numpy_dot(df):
return np.dot(df, df.T)


@pytest.mark.skip(
reason="AttributeError: 'ndarray' object has no attribute '_fsproxy_wrapped'"
)
def test_numpy_fft(sr):
fft = np.fft.fft(sr)
return fft
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def test_torch_train(data):
return model(test_x1, test_x2)


@pytest.mark.skip(
reason="AssertionError: The values for attribute 'device' do not match: cpu != cuda:0."
)
def test_torch_tensor_ctor():
s = pd.Series(range(5))
return torch.tensor(s.values)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def test_scatter(df):
return ax


@pytest.mark.skip(
reason="AttributeError: 'ndarray' object has no attribute '_fsproxy_wrapped'"
)
def test_lineplot_with_sns_data():
df = sns.load_dataset("flights")
ax = sns.lineplot(data=df, x="month", y="passengers")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_multidimensional_distributed_timeseries(dask_client):
rng = np.random.default_rng(seed=42)
# Each row represents data from a different dimension while each column represents
# data from the same dimension
your_time_series = rng.random(3, 1000)
your_time_series = rng.random((3, 1000))
# Approximately, how many data points might be found in a pattern
window_size = 50

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def call(self, values):
return tf.concat(values, axis=-1)


@pytest.mark.xfail(reason="ValueError: Invalid dtype: object")
def test_full_example_train_with_df(df, target):
# https://www.tensorflow.org/tutorials/load_data/pandas_dataframe#full_example
# Inputs are directly passed as dictionary of series
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def test_with_external_memory(
return predt


@pytest.mark.skip(
reason="TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to construct a NumPy array explicitly."
)
@pytest.mark.parametrize("device", ["cpu", "cuda"])
def test_predict(device: str) -> np.ndarray:
reg = xgb.XGBRegressor(n_estimators=2, device=device)
Expand Down

0 comments on commit 5baaf6d

Please sign in to comment.