File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1818import functools
1919import itertools
2020from typing import Any , Callable , Iterable
21+ import warnings
2122
2223from arolla import arolla
2324from koladata .expr import py_expr_eval_py_ext
@@ -822,6 +823,11 @@ def map_py_on_present(
822823 Returns:
823824 Result DataSlice.
824825 """
826+ warnings .warn (
827+ '`kd.map_py_on_present` is deprecated and will be removed, please use'
828+ ' `kd.map_py` instead' ,
829+ DeprecationWarning ,
830+ )
825831 if not args and not kwargs :
826832 raise TypeError ('expected at least one input DataSlice, got none' )
827833 cond = functools .reduce (
Original file line number Diff line number Diff line change 2828kde = kde_operators .kde
2929
3030
31- class PyMapPyOnSelectedTest (parameterized .TestCase ):
31+ class PyMapPyOnPresentTest (parameterized .TestCase ):
3232
3333 # Note: This operator is assembled from the same building blocks as
3434 # the operator `kde.py.map_py`, and these are tested together with that
3535 # operator.
3636
37+ def test_deprecated (self ):
38+ with self .assertWarns (DeprecationWarning ):
39+ _ = expr_eval .eval (kde .py .map_py_on_present (lambda x : x , ds ([])))
40+
3741 def test_args_kwargs (self ):
3842 x = ds ([1 , 2 , None ])
3943 y = ds ([3 , None , 4 ])
You can’t perform that action at this time.
0 commit comments