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

Function _make_global_functions

python/pyarrow/compute.py:314–340  ·  view source on GitHub ↗

Make global functions wrapping each compute function. Note that some of the automatically-generated wrappers may be overridden by custom versions below.

()

Source from the content-addressed store, hash-verified

312
313
314def _make_global_functions():
315 """
316 Make global functions wrapping each compute function.
317
318 Note that some of the automatically-generated wrappers may be overridden
319 by custom versions below.
320 """
321 g = globals()
322 reg = function_registry()
323
324 # Avoid clashes with Python keywords
325 rewrites = {'and': 'and_',
326 'or': 'or_'}
327
328 for cpp_name in reg.list_functions():
329 name = rewrites.get(cpp_name, cpp_name)
330 func = reg.get_function(cpp_name)
331 if func.kind == "hash_aggregate":
332 # Hash aggregate functions are not callable,
333 # so let's not expose them at module level.
334 continue
335 if func.kind == "scalar_aggregate" and func.arity == 0:
336 # Nullary scalar aggregate functions are not callable
337 # directly so let's not expose them at module level.
338 continue
339 assert name not in g, name
340 g[cpp_name] = g[name] = _wrap_function(name, func)
341
342
343_make_global_functions()

Callers 1

compute.pyFile · 0.85

Calls 3

function_registryFunction · 0.85
_wrap_functionFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected