Update decorators to more correctly set function metadata.
Review Request #13378 — Created Oct. 25, 2023 and submitted — Latest diff uploaded
Our API decorators and
@augment_method_fromattempted to set their own
function metadata (__name__,__doc__, etc.), rather than utilizing
Python's@wraps/update_wrapperfunctions. This meant that we weren't
keeping up with all the latest attributes, such as__annotations__and
__qualname__.This change switches some of our decorators over to this. It also
simplifies@webapi_response_errorsto not require an inner function
call, modifying state on the original function instead, reducing API
overhead.
Unit tests pass.
Verified I could access the original function state (
__qualname__in
particular) when working with these functions.