I'm guessing that the settings-reading code in gen_to_unit was written before the @consumer wrapper was written.
If you dive into getfullargspec, the first thing it does is call _signature_from_callable(func, follow_wrapper_chains=False, ...).
If we could set that to follow_wrapper_chains=True then it would properly inspect the wrapped-function's arguments. But that is hard-coded.
In our case, this hasn't been too detrimental so far because we are still able to get the settings annotations using get_type_hints(func) but this doesn't know anything about default values.
I think it's the same issue as here: https://github.com/joblib/joblib/issues/1164
I'm guessing that the settings-reading code in gen_to_unit was written before the
@consumer
wrapper was written.If you dive into
getfullargspec
, the first thing it does is call_signature_from_callable(func, follow_wrapper_chains=False, ...)
. If we could set that tofollow_wrapper_chains=True
then it would properly inspect the wrapped-function's arguments. But that is hard-coded.In our case, this hasn't been too detrimental so far because we are still able to get the settings annotations using
get_type_hints(func)
but this doesn't know anything about default values.