INNER CODE UNIT · Python
wrap_mlem_cli_call
iterative/mlem · mlem/cli/main.py:489
def wrap_mlem_cli_call(f, pass_from_parent: Optional[List[str]]):
@wraps(f)
def inner(*iargs, **ikwargs):
error = None
ctx = click.get_current_context()
cmd_name = get_cmd_name(ctx, include_dynamic=False)
with telemetry.event_scope("cli", cmd_name) as event:
try:
if pass_from_parent is not None:
ikwargs.update(
{
o: ctx.parent.params[o]
for o in pass_from_parent
if o in ctx.parent.params
and (o not in ikwargs or ikwargs[o] is None)
}
)
with cli_echo() if not ctx.obj["quiet"] else no_echo():