b17e18b4224450aeb24e61d5545016dfe3f1b81a,descarteslabs/workflows/execution/arguments.py,,promote_arguments,#Any#Any#,83

Before Change


    for param in params:
        arg = arguments[param._name]

        try:
            promoted = param._promote(arg)
        except ProxyTypeError as e:
            raise TypeError(
                f"For argument {param._name!r}: expected {type(param).__name__} or an object "
                f"promotable to that, but got {type(arg).__name__}: {arg!r}."
                f"\n\n{e}"
            )

        // Check arguments don"t themselves depend on params
        if promoted.params:
            name = param._name
            param_names = tuple(p._name for p in promoted.params)
            raise ValueError(

After Change


    if len(obj.params) > 0:
        obj = Function.from_object(obj)

    if isinstance(obj, Function):
        if len(obj.arg_types) > 0:
            raise TypeError(
                f"{type(obj).__name__}: cannot use Functions with positional-only arguments "
                "for computation; all arguments must be named."
            )
        _, promoted_kwargs = obj._promote_arguments(**arguments)
        return obj, promoted_kwargs
    else:
        if arguments:
            raise TypeError(
                f"Expected no arguments, since the object does not depend on parameters "
                f"and isn"t a Function, but got arguments {tuple(arguments)!r}."
            )
        return obj, arguments
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: descarteslabs/descarteslabs-python
Commit Name: b17e18b4224450aeb24e61d5545016dfe3f1b81a
Time: 2021-01-05
Author: gabe@descarteslabs.com
File Name: descarteslabs/workflows/execution/arguments.py
Class Name:
Method Name: promote_arguments


Project Name: descarteslabs/descarteslabs-python
Commit Name: 68828f650886dad698320814f98ce520b31cb5a1
Time: 2020-02-06
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/containers/tuple_.py
Class Name: Tuple
Method Name: __getitem__


Project Name: descarteslabs/descarteslabs-python
Commit Name: bc0a284284e49f72fe358f6064a30a54d0a112f4
Time: 2020-03-10
Author: gabe@descarteslabs.com
File Name: descarteslabs/workflows/types/numpy/numpy_overrides.py
Class Name: ufunc
Method Name: __call__


Project Name: descarteslabs/descarteslabs-python
Commit Name: 2c76358bcdbd01b199c04893370c3b06e867cca9
Time: 2020-03-30
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/array/masked_array.py
Class Name:
Method Name: _promote_fill_value