-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable testing
cudf.pandas
unit tests for all minor versions of pan…
…das (#16595) Fixes: #16537 This PR enables testing `cudf.pandas` unit tests with all minor versions of pandas-2 Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Bradley Dice (https://github.com/bdice) URL: #16595
- Loading branch information
1 parent
83f68c9
commit 91f304e
Showing
4 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
|
||
import requests | ||
from packaging.version import Version | ||
from packaging.specifiers import SpecifierSet | ||
import argparse | ||
|
||
def get_pandas_versions(pandas_range): | ||
url = "https://pypi.org/pypi/pandas/json" | ||
response = requests.get(url) | ||
data = response.json() | ||
versions = [Version(v) for v in data['releases']] | ||
specifier = SpecifierSet(pandas_range.lstrip("pandas")) | ||
matching_versions = [v for v in versions if v in specifier] | ||
matching_minors = sorted(set(".".join((str(v.major), str(v.minor))) for v in matching_versions), key=Version) | ||
return matching_minors | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Filter pandas versions by prefix.") | ||
parser.add_argument("pandas_range", type=str, help="The version prefix to filter by.") | ||
args = parser.parse_args() | ||
|
||
versions = get_pandas_versions(args.pandas_range) | ||
print(','.join(versions)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters