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

Function _make_global_functions

python/pyarrow/compute.py:315–341  ·  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

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