Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TypeError: 'float' object is not callable #63

Closed
@arithmetic1728

Description

@arithmetic1728

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.

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions