Skip to content

Commit

Permalink
fix benchmarks compatibility with newer pytest-cases (rapidsai#14764)
Browse files Browse the repository at this point in the history
Reverts changes from rapidsai#14756.

* updates `cudf`'s tests to be compatible with the latest `pytest-cases` ([version 3.8.2](https://pypi.org/project/pytest-cases/#history))
* puts a floor of `pytest-cases>=3.8.2` on that project to be sure older versions aren't used

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Ray Douglass (https://github.com/raydouglass)

URL: rapidsai#14764
  • Loading branch information
jameslamb authored Jan 18, 2024
1 parent c0a9510 commit eeee795
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies:
- pydata-sphinx-theme!=0.14.2
- pytest
- pytest-benchmark
- pytest-cases<3.8.2
- pytest-cases>=3.8.2
- pytest-cov
- pytest-xdist
- python-confluent-kafka>=1.9.0,<1.10.0a0
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies:
- pydata-sphinx-theme!=0.14.2
- pytest
- pytest-benchmark
- pytest-cases<3.8.2
- pytest-cases>=3.8.2
- pytest-cov
- pytest-xdist
- python-confluent-kafka>=1.9.0,<1.10.0a0
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ dependencies:
- fastavro>=0.22.9
- hypothesis
- pytest-benchmark
- pytest-cases<3.8.2
- pytest-cases>=3.8.2
- python-snappy>=0.6.0
- scipy
- output_types: conda
Expand Down
6 changes: 4 additions & 2 deletions python/cudf/benchmarks/API/bench_dataframe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

"""Benchmarks of DataFrame methods."""

Expand Down Expand Up @@ -178,6 +178,8 @@ def bench_nsmallest(benchmark, dataframe, num_cols_to_sort, n):
benchmark(dataframe.nsmallest, n, by)


@pytest_cases.parametrize_with_cases("dataframe, cond, other", prefix="where")
@pytest_cases.parametrize_with_cases(
"dataframe, cond, other", prefix="where", cases="cases_dataframe"
)
def bench_where(benchmark, dataframe, cond, other):
benchmark(dataframe.where, cond, other)
6 changes: 4 additions & 2 deletions python/cudf/benchmarks/API/bench_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

"""Benchmarks of free functions that accept cudf objects."""

Expand All @@ -9,7 +9,9 @@
from utils import benchmark_with_object


@pytest_cases.parametrize_with_cases("objs", prefix="concat")
@pytest_cases.parametrize_with_cases(
"objs", prefix="concat", cases="cases_functions"
)
@pytest.mark.parametrize(
"axis",
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

from utils import benchmark_with_object

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

"""Test cases for benchmarks in bench_functions.py."""

Expand Down
2 changes: 1 addition & 1 deletion python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test = [
"msgpack",
"pytest",
"pytest-benchmark",
"pytest-cases<3.8.2",
"pytest-cases>=3.8.2",
"pytest-cov",
"pytest-xdist",
"python-snappy>=0.6.0",
Expand Down

0 comments on commit eeee795

Please sign in to comment.