Skip to content

Commit

Permalink
test: convert cuDF numpy types to python types in tests (#987)
Browse files Browse the repository at this point in the history
* convert cuDF scalars to python types

* add pragma: no cover to tests
  • Loading branch information
LiamConnors authored Sep 18, 2024
1 parent 733c5e9 commit 9353ef9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def compare_dicts(result: Any, expected: dict[str, Any]) -> None:
lhs = lhs.as_py() # noqa: PLW2901
if hasattr(rhs, "as_py"): # pragma: no cover
rhs = rhs.as_py() # noqa: PLW2901
if hasattr(lhs, "item"): # pragma: no cover
lhs = lhs.item() # noqa: PLW2901
if hasattr(rhs, "item"): # pragma: no cover
rhs = rhs.item() # noqa: PLW2901
if isinstance(lhs, float) and not math.isnan(lhs):
assert math.isclose(lhs, rhs, rel_tol=0, abs_tol=1e-6), (lhs, rhs)
elif isinstance(lhs, float) and math.isnan(lhs):
Expand Down

0 comments on commit 9353ef9

Please sign in to comment.