René's URL Explorer Experiment


Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core · GitHub

Open Graph Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core

X Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core

Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a useful check, but the implementation adds significant overhead, almost doubling the processing time in a quick benchmark I ran (0.94s -> 1.84s) This PR moves the check to happen once at wrap time, instead of on each retry attempt. This should give us most of the benefits, without the ongoing performance hit Note that this implementaiton isn't quite as thouogh as the previous one: iscouroutinefunction won't catch standard functions that happen to return an awaitable, like the previous implementation would. But I think this trade-off is worth it for the performance gain Fixes #542

Open Graph Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us...

X Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us...

Opengraph URL: https://github.com/googleapis/python-api-core/pull/649

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a36f051a-7abb-df9a-f1e9-dbcde7a051ce
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBA78:20C9D0:86782C:B990EE:6A4DD841
html-safe-nonce223949af71f69bfef26386cde3f4176ea9d017e3aade13b91e787e8db72b68d1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTc4OjIwQzlEMDo4Njc4MkM6Qjk5MEVFOjZBNEREODQxIiwidmlzaXRvcl9pZCI6IjEzNjAzMTM3NjA0NDMzOTAwMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace66110b515fe7ffa304a5fc1028d35a5679c106d412257c91dac18acb7422d4a
hovercard-subject-tagpull_request:1854014432
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/googleapis/python-api-core/pull/649/files
twitter:imagehttps://avatars.githubusercontent.com/u/3914119?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3914119?s=400&v=4
og:image:altWe recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992456
octolytics-dimension-repository_nwogoogleapis/python-api-core
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992456
octolytics-dimension-repository_network_root_nwogoogleapis/python-api-core
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/pull/649/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fpull%2F649%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fpull%2F649%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=googleapis%2Fpython-api-core
Reloadhttps://github.com/googleapis/python-api-core/pull/649/files
Reloadhttps://github.com/googleapis/python-api-core/pull/649/files
Reloadhttps://github.com/googleapis/python-api-core/pull/649/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/649/files
googleapis https://github.com/googleapis
python-api-corehttps://github.com/googleapis/python-api-core
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Fork 97 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Star 144 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Code https://github.com/googleapis/python-api-core
Issues 0 https://github.com/googleapis/python-api-core/issues
Pull requests 0 https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality 0 https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
Code https://github.com/googleapis/python-api-core
Issues https://github.com/googleapis/python-api-core/issues
Pull requests https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
partheahttps://github.com/parthea
mainhttps://github.com/googleapis/python-api-core/tree/main
move_async_warninghttps://github.com/googleapis/python-api-core/tree/move_async_warning
Conversation 0 https://github.com/googleapis/python-api-core/pull/649
Commits 5 https://github.com/googleapis/python-api-core/pull/649/commits
Checks 0 https://github.com/googleapis/python-api-core/pull/649/checks
Files changed https://github.com/googleapis/python-api-core/pull/649/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/649/files
chore: move retry async check to wrap time https://github.com/googleapis/python-api-core/pull/649/files#top
Show all changes 5 commits https://github.com/googleapis/python-api-core/pull/649/files
3083ec0 chore: move retry async check to wrap time daniel-sanche May 3, 2024 https://github.com/googleapis/python-api-core/pull/649/commits/3083ec04c8308028a95a41115fdc08f265ecb0d9
3d3c338 🦉 Updates from OwlBot post-processor gcf-owl-bot[bot] May 3, 2024 https://github.com/googleapis/python-api-core/pull/649/commits/3d3c338e5335c9f6bd5eeb73b16b331e426a5d75
7026cc0 Merge branch 'main' into move_async_warning daniel-sanche May 3, 2024 https://github.com/googleapis/python-api-core/pull/649/commits/7026cc05b7454e5f35a17acdbb6db17af29c2e05
3d4bb2c added no cover mark daniel-sanche May 3, 2024 https://github.com/googleapis/python-api-core/pull/649/commits/3d4bb2c8597b7adf2980524152896628fb693ef9
f72f5da Merge branch 'main' into move_async_warning parthea Jun 4, 2024 https://github.com/googleapis/python-api-core/pull/649/commits/f72f5da9c4a787062e14f3304afbff5c0628b850
Clear filters https://github.com/googleapis/python-api-core/pull/649/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/649/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/649/files
retry_unary.py https://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
test_retry_unary.py https://github.com/googleapis/python-api-core/pull/649/files#diff-18e5aecd62e106e782bd5eabb097257f1e5b78c02deaf7b019653a9496cd70bd
google/api_core/retry/retry_unary.pyhttps://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
View file https://github.com/googleapis/python-api-core/blob/f72f5da9c4a787062e14f3304afbff5c0628b850/google/api_core/retry/retry_unary.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/googleapis/python-api-core/pull/649/{{ revealButtonHref }}
https://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
https://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
https://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
https://github.com/googleapis/python-api-core/pull/649/files#diff-136eb84e0322010c208395fe85d94cf83358b7b9479a51db7887f80cf3bf5828
tests/unit/retry/test_retry_unary.pyhttps://github.com/googleapis/python-api-core/pull/649/files#diff-18e5aecd62e106e782bd5eabb097257f1e5b78c02deaf7b019653a9496cd70bd
View file https://github.com/googleapis/python-api-core/blob/f72f5da9c4a787062e14f3304afbff5c0628b850/tests/unit/retry/test_retry_unary.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/googleapis/python-api-core/pull/649/{{ revealButtonHref }}
https://github.com/googleapis/python-api-core/pull/649/files#diff-18e5aecd62e106e782bd5eabb097257f1e5b78c02deaf7b019653a9496cd70bd
https://github.com/googleapis/python-api-core/pull/649/files#diff-18e5aecd62e106e782bd5eabb097257f1e5b78c02deaf7b019653a9496cd70bd
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.