Skip to content
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

Enable testing cudf.pandas unit tests for all minor versions of pandas #16595

Merged
merged 43 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9da733f
initial commit
galipremsagar Aug 19, 2024
bb8bc13
test
galipremsagar Aug 19, 2024
1d0dae3
test
galipremsagar Aug 19, 2024
3909c4d
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 19, 2024
f88780f
test
galipremsagar Aug 19, 2024
3461362
Merge branch 'pandas_minor_ver_ci' of https://github.com/galipremsaga…
galipremsagar Aug 19, 2024
c3e7ee1
add py file
galipremsagar Aug 19, 2024
2b361e0
disable
galipremsagar Aug 19, 2024
e5ef72a
pass pandas version
galipremsagar Aug 19, 2024
9773185
add pandas version
galipremsagar Aug 19, 2024
6f2b962
update
galipremsagar Aug 19, 2024
84342cb
test
galipremsagar Aug 19, 2024
704f75d
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 19, 2024
4e9706f
style
galipremsagar Aug 19, 2024
2aff0b4
Merge branch 'pandas_minor_ver_ci' of https://github.com/galipremsaga…
galipremsagar Aug 19, 2024
77b546a
Update .github/workflows/pr.yaml
galipremsagar Aug 19, 2024
ba26ab2
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 19, 2024
74528f9
Fix tests
galipremsagar Aug 20, 2024
9c8c0c3
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 20, 2024
95fde99
use filter
galipremsagar Aug 20, 2024
d515f62
Merge branch 'pandas_minor_ver_ci' of https://github.com/galipremsaga…
galipremsagar Aug 20, 2024
b6cbc5f
Address reviews
galipremsagar Aug 21, 2024
c5585f9
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 21, 2024
191b7a2
fix yaml
galipremsagar Aug 21, 2024
f2d953f
Merge branch 'pandas_minor_ver_ci' of https://github.com/galipremsaga…
galipremsagar Aug 21, 2024
16c5a8b
install packaging'
galipremsagar Aug 21, 2024
efce401
Apply suggestions from code review
galipremsagar Aug 21, 2024
b69c105
Update pr.yaml
galipremsagar Aug 21, 2024
877392b
Update python/cudf/cudf_pandas_tests/test_profiler.py
galipremsagar Aug 21, 2024
723e484
Update test_cudf_pandas.py
galipremsagar Aug 21, 2024
c3a985b
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 21, 2024
98a97f6
improve
galipremsagar Aug 21, 2024
782c938
update
galipremsagar Aug 22, 2024
f400708
update
galipremsagar Aug 22, 2024
b172637
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 22, 2024
6165bf9
update path
galipremsagar Aug 22, 2024
a0161f7
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 22, 2024
810fcca
fix path
galipremsagar Aug 22, 2024
062494b
Merge branch 'pandas_minor_ver_ci' of https://github.com/galipremsaga…
galipremsagar Aug 22, 2024
5fcf7c5
Apply suggestions from code review
galipremsagar Aug 22, 2024
f1b6840
Update ci/cudf_pandas_scripts/fetch_pandas_versions.py
galipremsagar Aug 23, 2024
8c58b3f
simplify
galipremsagar Aug 23, 2024
47de3f2
Merge branch 'branch-24.10' into pandas_minor_ver_ci
galipremsagar Aug 23, 2024
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
33 changes: 33 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- wheel-tests-dask-cudf
- devcontainer
- unit-tests-cudf-pandas
- fetch-pandas-versions
- cross-pandas-version-tests
- pandas-tests
- pandas-tests-diff
secrets: inherit
Expand All @@ -41,6 +43,37 @@ jobs:
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
fetch-pandas-versions:
runs-on: ubuntu-latest
outputs:
pandas-versions: ${{ steps.get-versions.outputs.versions }}
steps:
- name: Checkout code
uses: actions/checkout@v2
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Python
uses: actions/setup-python@v2
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
with:
python-version: '3.11'

- name: Install requests
run: pip install requests

- name: Fetch pandas versions
id: get-versions
run: |
versions=$(python fetch_pandas_versions.py)
echo "::set-output name=versions::${versions}"
cross-pandas-version-tests:
needs: [fetch-pandas-versions, wheel-build-cudf]
secrets: inherit
strategy:
matrix:
pandas-version: ${{ fromJson(needs.fetch-pandas-versions.outputs.pandas-versions) }}
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/test_wheel_cudf.sh ${{ matrix.pandas-version }}
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
conda-cpp-build:
needs: checks
secrets: inherit
Expand Down
22 changes: 18 additions & 4 deletions ci/cudf_pandas_scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"

# Function to display script usage
function display_usage {
echo "Usage: $0 [--no-cudf]"
echo "Usage: $0 [--no-cudf] [pandas-version]"
}

# Default value for the --no-cudf option
no_cudf=false
PANDAS_VERSION=""

# Parse command-line arguments
while [[ $# -gt 0 ]]; do
Expand All @@ -25,9 +26,14 @@ while [[ $# -gt 0 ]]; do
shift
;;
*)
echo "Error: Unknown option $1"
display_usage
exit 1
if [[ -z "$PANDAS_VERSION" ]]; then
PANDAS_VERSION=$1
shift
else
echo "Error: Unknown option $1"
display_usage
exit 1
fi
;;
esac
done
Expand All @@ -42,6 +48,14 @@ else
python -m pip install $(ls ./local-cudf-dep/cudf*.whl)[test,cudf-pandas-tests]
fi

# Conditionally install the specified version of pandas
if [ -n "$PANDAS_VERSION" ]; then
echo "Installing pandas version: $PANDAS_VERSION"
python -m pip install pandas==$PANDAS_VERSION
else
echo "No pandas version specified, using existing pandas installation"
fi

python -m pytest -p cudf.pandas \
--cov-config=./python/cudf/.coveragerc \
--cov=cudf \
Expand Down
25 changes: 25 additions & 0 deletions fetch_pandas_versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
import requests

def get_pandas_versions():
url = "https://pypi.org/pypi/pandas/json"
response = requests.get(url)
data = response.json()
versions = data['releases'].keys()

# Filter out pre-releases and major versions
minor_versions = sorted(set(
'.'.join(version.split('.')[:2]) for version in versions if 'rc' not in version and 'b' not in version
))

# Remove duplicates and sort
minor_versions = sorted(set(minor_versions))

# Filter for versions starting from 2.0
minor_versions = [v for v in minor_versions if v.startswith('2.')]

return minor_versions

if __name__ == "__main__":
versions = get_pandas_versions()
print(versions)
Loading