-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce version file so we can conditionally handle things in tests (…
…#16280) We decided we would attempt to support a range of versions back to 1.0. We'll test with oldest and newest versions we support. To facilitate, introduce some versioning constants. Authors: - Lawrence Mitchell (https://github.com/wence-) Approvers: - Thomas Li (https://github.com/lithomas1) URL: #16280
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
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
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,28 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"""Version utilities so that cudf_polars supports a range of polars versions.""" | ||
|
||
# ruff: noqa: SIM300 | ||
from __future__ import annotations | ||
|
||
from packaging.version import parse | ||
|
||
from polars import __version__ | ||
|
||
POLARS_VERSION = parse(__version__) | ||
|
||
POLARS_VERSION_GE_10 = POLARS_VERSION >= parse("1.0") | ||
POLARS_VERSION_GE_11 = POLARS_VERSION >= parse("1.1") | ||
POLARS_VERSION_GE_12 = POLARS_VERSION >= parse("1.2") | ||
POLARS_VERSION_GT_10 = POLARS_VERSION > parse("1.0") | ||
POLARS_VERSION_GT_11 = POLARS_VERSION > parse("1.1") | ||
POLARS_VERSION_GT_12 = POLARS_VERSION > parse("1.2") | ||
|
||
POLARS_VERSION_LE_12 = POLARS_VERSION <= parse("1.2") | ||
POLARS_VERSION_LE_11 = POLARS_VERSION <= parse("1.1") | ||
POLARS_VERSION_LT_12 = POLARS_VERSION < parse("1.2") | ||
POLARS_VERSION_LT_11 = POLARS_VERSION < parse("1.1") | ||
|
||
if POLARS_VERSION < parse("1.0"): # pragma: no cover | ||
raise ImportError("cudf_polars requires py-polars v1.0 or greater.") |
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