René's URL Explorer Experiment


Title: Test regression when grpcio is installed but grpcio-status is not · Issue #301 · googleapis/python-api-core · GitHub

Open Graph Title: Test regression when grpcio is installed but grpcio-status is not · Issue #301 · googleapis/python-api-core

X Title: Test regression when grpcio is installed but grpcio-status is not · Issue #301 · googleapis/python-api-core

Description: CC @atulep The following commit causes a regression in the test suite: commit ef6f0fcfdfe771172056e35e3c990998b3b00416 Author: Aza Tulepbergenov Date: 2021-10-19 20:17:49 +0200 feat: add 'GoogleAPICallError.error...

Open Graph Description: CC @atulep The following commit causes a regression in the test suite: commit ef6f0fcfdfe771172056e35e3c990998b3b00416 Author: Aza Tulepbergenov Date: 2021-10-19 20:17:49 +...

X Description: CC @atulep The following commit causes a regression in the test suite: commit ef6f0fcfdfe771172056e35e3c990998b3b00416 Author: Aza Tulepbergenov <aza.tulepber@gmail.com> Date: 2021-10-19 20:1...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test regression when grpcio is installed but grpcio-status is not","articleBody":"CC @atulep \r\n\r\nThe following commit causes a regression in the test suite:\r\n```\r\ncommit ef6f0fcfdfe771172056e35e3c990998b3b00416\r\nAuthor: Aza Tulepbergenov \u003caza.tulepber@gmail.com\u003e\r\nDate:   2021-10-19 20:17:49 +0200\r\n\r\n    feat: add 'GoogleAPICallError.error_details' property (#286)\r\n    \r\n    Based on 'google.rpc.status.details'.\r\n```\r\n\r\nPrior to this commit, the package handled both missing and present `grpc` consistently. However, the following condition in `exceptions.py`:\r\n\r\n```\r\ntry:\r\n    import grpc\r\n    from grpc_status import rpc_status\r\nexcept ImportError:  # pragma: NO COVER\r\n    grpc = None\r\n    rpc_status = None\r\n```\r\n\r\nmeans that if `grpc_status` module is not installed, the exception module behaves as if `grpc` wasn't present even though other modules (notably tests) behave as if it was present. As a result, people having one but not the other module installed get a bunch of test failures because grpc-based tests are run but e.g. the `exception` module's `from_grpc_error()` function fails since `grpc` is forced to `None`.\r\n\r\nThis is especially problematic since `grpcio-status` is a new optional dependency, and since it's not packaged on Gentoo, we'd effectively have to force people to uninstall `grpcio`.\r\n\r\n#### Environment details\r\n\r\n  - OS type and version: Gentoo Linux\r\n  - Python version: `python --version` 3.8.12, 3.9.7\r\n  - pip version: `pip --version` n/a\r\n  - `google-api-core` version: `pip show google-api-core` 2.2.0, 2.2.1, git master (d2a729e0c42039bfbcd4b59c3d97d8759a9f0d57)\r\n\r\n#### Steps to reproduce\r\n\r\n  1. `git clone https://github.com/googleapis/python-api-core`\r\n  2. `cd python-api-core`\r\n  3. `python3.9 -m venv .venv`\r\n  4. `. .venv/bin/activate`\r\n  5. `pip install . grpcio pytest mock proto-plus pytest-asyncio`\r\n  6. `pytest`\r\n\r\n#### Stack trace\r\nExample test failure:\r\n```\r\n_______________________________________________________ test_wrap_unary_errors ________________________________________________________\r\n\r\nself = \u003cgoogle.api_core.grpc_helpers_async._WrappedUnaryUnaryCall object at 0x7fe0e3de3790\u003e\r\n\r\n    def __await__(self):\r\n        try:\r\n\u003e           response = yield from self._call.__await__()\r\n\r\n.venv/lib/python3.9/site-packages/google/api_core/grpc_helpers_async.py:84: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\n_mock_self = \u003cAsyncMock id='140603872279952'\u003e, args = (1, 2), kwargs = {'three': 'four'}, self = \u003cAsyncMock id='140603872279952'\u003e\r\n_call = call(1, 2, three='four'), effect = RpcErrorImpl()\r\n\r\n    async def _execute_mock_call(_mock_self, *args, **kwargs):\r\n        self = _mock_self\r\n        # This is nearly just like super(), except for special handling\r\n        # of coroutines\r\n    \r\n        _call = _Call((args, kwargs), two=True)\r\n        self.await_count += 1\r\n        self.await_args = _call\r\n        self.await_args_list.append(_call)\r\n    \r\n        effect = self.side_effect\r\n        if effect is not None:\r\n            if _is_exception(effect):\r\n\u003e               raise effect\r\nE               tests.asyncio.test_grpc_helpers_async.RpcErrorImpl\r\n\r\n.venv/lib/python3.9/site-packages/mock/mock.py:2169: RpcErrorImpl\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\n    @pytest.mark.asyncio\r\n    async def test_wrap_unary_errors():\r\n        grpc_error = RpcErrorImpl(grpc.StatusCode.INVALID_ARGUMENT)\r\n        callable_ = mock.AsyncMock(spec=[\"__call__\"], side_effect=grpc_error)\r\n    \r\n        wrapped_callable = grpc_helpers_async._wrap_unary_errors(callable_)\r\n    \r\n        with pytest.raises(exceptions.InvalidArgument) as exc_info:\r\n\u003e           await wrapped_callable(1, 2, three=\"four\")\r\n\r\ntests/asyncio/test_grpc_helpers_async.py:57: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n.venv/lib/python3.9/site-packages/google/api_core/grpc_helpers_async.py:87: in __await__\r\n    raise exceptions.from_grpc_error(rpc_error) from rpc_error\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\nrpc_exc = RpcErrorImpl()\r\n\r\n    def from_grpc_error(rpc_exc):\r\n        \"\"\"Create a :class:`GoogleAPICallError` from a :class:`grpc.RpcError`.\r\n    \r\n        Args:\r\n            rpc_exc (grpc.RpcError): The gRPC error.\r\n    \r\n        Returns:\r\n            GoogleAPICallError: An instance of the appropriate subclass of\r\n                :class:`GoogleAPICallError`.\r\n        \"\"\"\r\n        # NOTE(lidiz) All gRPC error shares the parent class grpc.RpcError.\r\n        # However, check for grpc.RpcError breaks backward compatibility.\r\n\u003e       if isinstance(rpc_exc, grpc.Call) or _is_informative_grpc_error(rpc_exc):\r\nE       AttributeError: 'NoneType' object has no attribute 'Call'\r\n\r\n.venv/lib/python3.9/site-packages/google/api_core/exceptions.py:532: AttributeError\r\n======================================================= short test summary info =======================================================\r\nFAILED tests/asyncio/test_grpc_helpers_async.py::test_wrap_unary_errors - AttributeError: 'NoneType' object has no attribute 'Call'\r\n```","author":{"url":"https://github.com/mgorny","@type":"Person","name":"mgorny"},"datePublished":"2021-10-28T20:50:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/301/python-api-core/issues/301"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e36f3fb3-2215-c428-9ae4-9cb3308606d0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCB0:C86CC:6F4530:A22C3F:6A4E0EBD
html-safe-nonce7953bddca487412a9efe52787258fee192dc1e7fe9f883a0c358b51d892431c8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0IwOkM4NkNDOjZGNDUzMDpBMjJDM0Y6NkE0RTBFQkQiLCJ2aXNpdG9yX2lkIjoiNjMwNzQ5MTYxMDA3NTQ2NzQ1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac73a7ca4472e5fe58b866a02d2f5ec3bc4b9193a4b065f0f0d78c74c9ba96e5bd
hovercard-subject-tagissue:1038942131
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/301/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cf48283cf218b5a6f2e75fdc39033c60b27cbf317b8c967adb646e6ae4d22757/googleapis/python-api-core/issues/301
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cf48283cf218b5a6f2e75fdc39033c60b27cbf317b8c967adb646e6ae4d22757/googleapis/python-api-core/issues/301
og:image:altCC @atulep The following commit causes a regression in the test suite: commit ef6f0fcfdfe771172056e35e3c990998b3b00416 Author: Aza Tulepbergenov Date: 2021-10-19 20:17:49 +...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemgorny
hostnamegithub.com
expected-hostnamegithub.com
Nonedf0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6
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
release51470c353b8a1f52a88d3e3cc2014b17ab8cc1ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/issues/301#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fissues%2F301
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%2F301
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/301
Reloadhttps://github.com/googleapis/python-api-core/issues/301
Reloadhttps://github.com/googleapis/python-api-core/issues/301
Please reload this pagehttps://github.com/googleapis/python-api-core/issues/301
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
#355https://github.com/googleapis/python-api-core/pull/355
Test regression when grpcio is installed but grpcio-status is nothttps://github.com/googleapis/python-api-core/issues/301#top
#355https://github.com/googleapis/python-api-core/pull/355
https://github.com/parthea
https://github.com/busunkim96
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%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/mgorny
mgornyhttps://github.com/mgorny
on Oct 28, 2021https://github.com/googleapis/python-api-core/issues/301#issue-1038942131
@atulephttps://github.com/atulep
d2a729ehttps://github.com/googleapis/python-api-core/commit/d2a729e0c42039bfbcd4b59c3d97d8759a9f0d57
busunkim96https://github.com/busunkim96
partheahttps://github.com/parthea
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-api-core/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%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.