aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/python/python3_small/test/cases/GreedyInputContainers.sql
blob: a43af8791d6b6ae85245bf3184f9268a513fd288 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--sanitizer ignore memory
/* syntax version 1 */
$s = @@
def list_func(lst):
  return lst.count(1)
list_func._yql_lazy_input = False
@@;

$u = Python3::list_func(Callable<(List<Int32>)->Int32>, $s);
select $u(AsList(1,2,3));

$s = @@
def dict_func(dict):
  return list(dict.values()).count(b"b")
dict_func._yql_lazy_input = False
@@;

$v = Python3::dict_func(Callable<(Dict<Int32, String>)->Int32>, $s);
select $v(AsDict(AsTuple(1,"a"),AsTuple(2,"b")));