Closed
Description
How to reproduce:
(1) clone https://github.com/googleapis/python-cloudbuild and checkout sijun
branch.
(2) run python -m nox -s unit-3.6 -- -s
Exception thrown:
def _apply_decorators(func, decorators):
"""Apply a list of decorators to a given function.
``decorators`` may contain items that are ``None`` or ``False`` which will
be ignored.
"""
decorators = filter(_is_not_none_or_false, reversed(decorators))
for decorator in decorators:
> func = decorator(func)
E TypeError: 'float' object is not callable
Description of the bug:
google.api_core.gapic_v1.method._GapicCallable.__call__
calls _determine_timeout
to create an timeout_
object, then passes it to _apply_decorators(self._target, [retry, timeout_])
.
In my example, _determine_timeout(600.0, 600.0, None)
creates/returns 600.0
, which is a float object, when it is passed to _apply_decorators
, the 'float' object is not callable is raised.
_determine_timeout
should always return a Timeout object.