GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Raise a warning in google.api_core.retry.retry_target if the return value is awaitable · Issue #542 · googleapis/python-api-core

This repository was archived by the owner on Feb 23, 2026. It is now read-only.
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Raise a warning in google.api_core.retry.retry_target if the return value is awaitable #542

Copy link
Copy link
Closed
#649
#543
Closed
Raise a warning in google.api_core.retry.retry_target if the return value is awaitable#542
#649
#543
Copy link
Assignees
ohmayr
Labels
type: questionRequest for information or clarification. Not an issue.

Description

@ohmayr
ohmayr
opened on Oct 25, 2023
Issue body actions

A warning can be raised within google.api_core.retry.retry_target depending on whether the return value of target() is awaitable in the following way:

if inspect.isawaitable(target()):
            raise ValueError("Incorrect use of Retry in async code. Use AsyncRetry instead")

This will ensure that google.api_core.retry.Retry is not incorrectly used in async clients/code and will suggest users to use google.api_core.retry_async.AsyncRetry instead

related issue: fix retries in async client

Activity

  1. ohmayr
    closed this as completedin #543on Nov 3, 2023
  2. daniel-sanche
    reopened this on Dec 1, 2023
  3. daniel-sanche commented on Dec 1, 2023

    @daniel-sanche
    daniel-sanche
    on Dec 1, 2023
    Contributor
    More actions

    I think this change should be re-considered. inspect.isawaitable is notoriously slow, and this change makes it a part of every single rpc. I don't think the benefit of the extra warning is worth adding that performance cost to every library

  4. parthea
    assigned
    ohmayr
    on Dec 1, 2023
  5. parthea
    added
    type: questionRequest for information or clarification. Not an issue.
    on Jan 26, 2024
  6. parthea
    closed this as completedin #649on Jun 4, 2024
  7. parthea
    reopened this on Jun 5, 2024
  8. parthea
    closed this as completedon Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ohmayr
    ohmayr

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.