René's URL Explorer Experiment


Title: Backward compatible import of retry_async does not work in 2.16.0 · Issue #586 · googleapis/python-api-core · GitHub

Open Graph Title: Backward compatible import of retry_async does not work in 2.16.0 · Issue #586 · googleapis/python-api-core

X Title: Backward compatible import of retry_async does not work in 2.16.0 · Issue #586 · googleapis/python-api-core

Description: The code aimed to maintain backwards compatibity when importing retry_async did not work when the . Environment details OS type and version: Dockerised Debian Bookwork Python version: python --version: 3.8.18 pip version: pip --version: ...

Open Graph Description: The code aimed to maintain backwards compatibity when importing retry_async did not work when the . Environment details OS type and version: Dockerised Debian Bookwork Python version: python --vers...

X Description: The code aimed to maintain backwards compatibity when importing retry_async did not work when the . Environment details OS type and version: Dockerised Debian Bookwork Python version: python --vers...

Opengraph URL: https://github.com/googleapis/python-api-core/issues/586

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Backward compatible import of retry_async does not work in 2.16.0","articleBody":"The code aimed to maintain backwards compatibity when importing `retry_async` did not work when the .\r\n\r\n\r\n#### Environment details\r\n\r\n  - OS type and version: Dockerised Debian Bookwork\r\n  - Python version: `python --version`: 3.8.18\r\n  - pip version: `pip --version`: 23.3.2\r\n  - `google-api-core` version: `pip show google-api-core`\r\n\r\n```\r\nName: google-api-core\r\nVersion: 2.16.0\r\nSummary: Google API client core library\r\nHome-page: https://github.com/googleapis/python-api-core\r\nAuthor: Google LLC\r\nAuthor-email: googleapis-packages@google.com\r\nLicense: Apache 2.0\r\nLocation: /usr/local/lib/python3.8/site-packages\r\nRequires: google-auth, googleapis-common-protos, protobuf, requests\r\nRequired-by: google-ads, google-analytics-admin, google-api-python-client, google-cloud-aiplatform, google-cloud-appengine-logging, google-cloud-automl, google-cloud-batch, google-cloud-bigquery, google-cloud-bigquery-datatransfer, google-cloud-bigquery-storage, google-cloud-bigtable, google-cloud-build, google-cloud-compute, google-cloud-container, google-cloud-core, google-cloud-datacatalog, google-cloud-dataflow-client, google-cloud-dataform, google-cloud-dataplex, google-cloud-dataproc, google-cloud-dataproc-metastore, google-cloud-dlp, google-cloud-kms, google-cloud-language, google-cloud-logging, google-cloud-memcache, google-cloud-monitoring, google-cloud-orchestration-airflow, google-cloud-os-login, google-cloud-pubsub, google-cloud-redis, google-cloud-resource-manager, google-cloud-run, google-cloud-secret-manager, google-cloud-spanner, google-cloud-speech, google-cloud-storage, google-cloud-storage-transfer, google-cloud-tasks, google-cloud-texttospeech, google-cloud-translate, google-cloud-videointelligence, google-cloud-vision, google-cloud-workflows, pandas-gbq, sqlalchemy-bigquery\r\n```\r\n\r\n#### Steps to reproduce\r\n\r\n  1. Run `pip insall google-api-core==2.15.0`\r\n  2. Enter python repl with `python`\r\n  3. Run `from google.api_core.retry_async import AsyncRetry` -\u003e this nicely works\r\n  4. Run `from google.api_core.retry import AsyncRetry` -\u003e this does not work (as expected)\r\n\r\n```\r\n\u003e\u003e\u003e from google.api_core.retry import AsyncRetry\r\nTraceback (most recent call last):\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nImportError: cannot import name 'AsyncRetry' from 'google.api_core.retry' (/usr/local/lib/python3.8/site-packages/google/api_core/retry.py)\r\n```\r\n\r\n5. Run `pip insall google-api-core==2.16.0`\r\n6. Enter python repl with `python`\r\n7. Run `from google.api_core.retry_async import AsyncRetry` -\u003e this does not work (but should)\r\n\r\n```\r\n\u003e\u003e\u003e from google.api_core.retry_async import AsyncRetry\r\nTraceback (most recent call last):\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nModuleNotFoundError: No module named 'google.api_core.retry_async'\r\n\u003e\u003e\u003e \r\n```\r\n8. Run `from google.api_core.retry import AsyncRetry` -\u003e this works (as expected)\r\n\r\n----\r\n\r\nThere was an attempt in #495 to make it work:\r\n\r\nIn: google/api_core/__init__.py\r\n\r\n```python\r\n# for backwards compatibility, expose async unary retries as google.api_core.retry_async\r\nfrom .retry import retry_unary_async as retry_async  # noqa: F401\r\n```\r\n\r\nThis is aimed to make `from google.api_core.retry_async import AsyncRetry` works, but importing a module into another modules `__init__` does not work the way it is supposed to work.\r\n\r\nWhile there was attempt to even test it in #577, it did not test the right imports:\r\n\r\n```python\r\ndef test_legacy_imports_retry_unary_async():\r\n    # TODO: Delete this test when when we revert these imports on the\r\n    #       next major version release\r\n    #       (https://github.com/googleapis/python-api-core/issues/576)\r\n    from google.api_core import retry_async  # noqa: F401\r\n```\r\n\r\nThe ` from google.api_core import retry_async` works, fine, but `from google.api_core.retry_async import AsyncRetry` still raises the `No module named 'google.api_core.retry_async` - bycause of the way how python resolves `from`.\r\n\r\nI guess good solution will be to add back the `retry_async` as a (mostly empty) submodule and import all the needed classess from the `retry_unary_async` package\r\n\r\n#### Code example\r\n\r\n```python\r\nfrom google.api_core.retry_async import AsyncRetry\r\nfrom google.api_core.retry import AsyncRetry\r\n```\r\n\r\n#### Stack trace\r\n```\r\n\u003e\u003e\u003e from google.api_core.retry_async import AsyncRetry\r\nTraceback (most recent call last):\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nModuleNotFoundError: No module named 'google.api_core.retry_async'\r\n\u003e\u003e\u003e \r\n```\r\n\r\nMaking sure to follow these steps will guarantee the quickest resolution possible.\r\n\r\nThanks!\r\n","author":{"url":"https://github.com/potiuk","@type":"Person","name":"potiuk"},"datePublished":"2024-01-30T12:04:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/586/python-api-core/issues/586"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f639b8a2-e484-c4b4-9816-5e27bff2dde4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC866:23F3E2:A8A3B:EC796:6A4DB77B
html-safe-nonce95fd93126ff8cb6e8c8d1d0b733399d1afd5e58aef3548ee6ee92b76919b9308
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODY2OjIzRjNFMjpBOEEzQjpFQzc5Njo2QTREQjc3QiIsInZpc2l0b3JfaWQiOiIyNDcwNzAzNzg4NzYwODcyODI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacce0005e143d0ce5022d92013aded3e00cff9a8106853a1dc312da58eeee2a9fa
hovercard-subject-tagissue:2107685002
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-api-core/586/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c7dbcc6bd5cea0be41627785f9b8dbf42e4dc695b063b2b1a2f30732314ed88f/googleapis/python-api-core/issues/586
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c7dbcc6bd5cea0be41627785f9b8dbf42e4dc695b063b2b1a2f30732314ed88f/googleapis/python-api-core/issues/586
og:image:altThe code aimed to maintain backwards compatibity when importing retry_async did not work when the . Environment details OS type and version: Dockerised Debian Bookwork Python version: python --vers...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepotiuk
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32f7b614aca06e6bbd89842b1370df1328264f68
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/issues/586#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fissues%2F586
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%2Fissues%2F586
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fpython-api-core
Reloadhttps://github.com/googleapis/python-api-core/issues/586
Reloadhttps://github.com/googleapis/python-api-core/issues/586
Reloadhttps://github.com/googleapis/python-api-core/issues/586
Please reload this pagehttps://github.com/googleapis/python-api-core/issues/586
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
#587https://github.com/googleapis/python-api-core/pull/587
Backward compatible import of retry_async does not work in 2.16.0https://github.com/googleapis/python-api-core/issues/586#top
#587https://github.com/googleapis/python-api-core/pull/587
https://github.com/ohmayr
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22priority%3A%20p1%22
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com/potiuk
potiukhttps://github.com/potiuk
on Jan 30, 2024https://github.com/googleapis/python-api-core/issues/586#issue-2107685002
#495https://github.com/googleapis/python-api-core/pull/495
#577https://github.com/googleapis/python-api-core/pull/577
ohmayrhttps://github.com/ohmayr
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22priority%3A%20p1%22
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
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.