-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba23652
commit 2b32837
Showing
1 changed file
with
32 additions
and
0 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,32 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
import os | ||
|
||
import polars as pl | ||
|
||
from cudf_polars.dsl.expr import Expr | ||
import cudf._lib.pylibcudf as plc | ||
|
||
|
||
class NotImplementedExpr(Expr): | ||
def do_evaluate(self, df, *, context, mapping): | ||
raise NotImplementedError("Example Unsupported cuDF operation") | ||
|
||
|
||
def invoke_unimplemented_op(df): | ||
# TODO: does not work | ||
# df.select(NotImplementedExpr(plc.DataType(plc.TypeId.INT64))) | ||
pass | ||
|
||
|
||
def test_polars_verbose_warns(): | ||
old_val = os.environ.get("POLARS_VERBOSE") | ||
os.environ["POLARS_VERBOSE"] = "1" | ||
df = pl.DataFrame({"a": [1, 2, 3]}).lazy() | ||
|
||
invoke_unimplemented_op(df) | ||
|
||
os.environ["POLARS_VERBOSE"] = old_val |