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

Function _handle_options

python/pyarrow/compute.py:224–241  ·  view source on GitHub ↗
(name, options_class, options, args, kwargs)

Source from the content-addressed store, hash-verified

222
223
224def _handle_options(name, options_class, options, args, kwargs):
225 if args or kwargs:
226 if options is not None:
227 raise TypeError(
228 f"Function {name!r} called with both an 'options' argument "
229 f"and additional arguments")
230 return options_class(*args, **kwargs)
231
232 if options is not None:
233 if isinstance(options, dict):
234 return options_class(**options)
235 elif isinstance(options, options_class):
236 return options
237 raise TypeError(
238 f"Function {name!r} expected a {options_class} parameter, "
239 f"got {type(options)}")
240
241 return None
242
243
244def _make_generic_wrapper(func_name, func, options_class, arity):

Callers 1

wrapperFunction · 0.85

Calls 2

TypeErrorFunction · 0.50
typeEnum · 0.50

Tested by

no test coverage detected