Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'float' object is not callable #63

Closed
arithmetic1728 opened this issue Jul 21, 2020 · 0 comments · Fixed by #64
Closed

TypeError: 'float' object is not callable #63

arithmetic1728 opened this issue Jul 21, 2020 · 0 comments · Fixed by #64
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@arithmetic1728
Copy link
Contributor

arithmetic1728 commented Jul 21, 2020

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.

@arithmetic1728 arithmetic1728 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jul 21, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 21, 2020
@busunkim96 busunkim96 added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jul 21, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants