MCPcopy Create free account
hub / github.com/apache/arrow / test_generated_signatures

Function test_generated_signatures

python/pyarrow/tests/test_compute.py:1002–1029  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1000
1001
1002def test_generated_signatures():
1003 # The self-documentation provided by signatures should show acceptable
1004 # options and their default values.
1005
1006 # Without options
1007 sig = inspect.signature(pc.add)
1008 assert str(sig) == "(x, y, /, *, memory_pool=None)"
1009 # With options
1010 sig = inspect.signature(pc.min_max)
1011 assert str(sig) == ("(array, /, *, skip_nulls=True, min_count=1, "
1012 "options=None, memory_pool=None)")
1013 # With positional options
1014 sig = inspect.signature(pc.quantile)
1015 assert str(sig) == ("(array, /, q=0.5, *, interpolation='linear', "
1016 "skip_nulls=True, min_count=0, "
1017 "options=None, memory_pool=None)")
1018 # Varargs with options
1019 sig = inspect.signature(pc.binary_join_element_wise)
1020 assert str(sig) == ("(*strings, null_handling='emit_null', "
1021 "null_replacement='', options=None, "
1022 "memory_pool=None)")
1023 # Varargs without options
1024 sig = inspect.signature(pc.choose)
1025 assert str(sig) == "(indices, /, *values, memory_pool=None)"
1026 # Nullary with options
1027 sig = inspect.signature(pc.random)
1028 assert str(sig) == ("(n, *, initializer='system', "
1029 "options=None, memory_pool=None)")
1030
1031
1032# We use isprintable to find about codepoints that Python doesn't know, but

Callers

nothing calls this directly

Calls 1

signatureMethod · 0.45

Tested by

no test coverage detected