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

Function _handle_options

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

Source from the content-addressed store, hash-verified

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