René's URL Explorer Experiment


Title: Issue · GitHub

Open Graph Title: Issue · googleapis/python-spanner

X Title: Issue · googleapis/python-spanner

Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner - Issue · googleapis/python-spanner

Open Graph Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner - Issue · googleapis/python-spanner

X Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner - Issue · googleapis/python-spanner

Opengraph URL: https://github.com/googleapis/python-spanner

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add custom retry and timeout options for partition reads and queries","articleBody":"I am building an application in Apache Beam and Python that runs in Google DataFlow. I am using the `ReadFromSpanner` method in `apache_beam.io.gcp.experimental.spannerio`. This works for most of my Spanner tables but the really large ones that are \u003e40m rows tend to fail due to the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.8/site-packages/dataflow_worker/batchworker.py\", line 649, in do_work\r\n    work_executor.execute()\r\n  File \"/usr/local/lib/python3.8/site-packages/dataflow_worker/executor.py\", line 179, in execute\r\n    op.start()\r\n  File \"dataflow_worker/shuffle_operations.py\", line 63, in dataflow_worker.shuffle_operations.GroupedShuffleReadOperation.start\r\n  File \"dataflow_worker/shuffle_operations.py\", line 64, in dataflow_worker.shuffle_operations.GroupedShuffleReadOperation.start\r\n  File \"dataflow_worker/shuffle_operations.py\", line 79, in dataflow_worker.shuffle_operations.GroupedShuffleReadOperation.start\r\n  File \"dataflow_worker/shuffle_operations.py\", line 80, in dataflow_worker.shuffle_operations.GroupedShuffleReadOperation.start\r\n  File \"dataflow_worker/shuffle_operations.py\", line 84, in dataflow_worker.shuffle_operations.GroupedShuffleReadOperation.start\r\n  File \"apache_beam/runners/worker/operations.py\", line 359, in apache_beam.runners.worker.operations.Operation.output\r\n  File \"apache_beam/runners/worker/operations.py\", line 221, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive\r\n  File \"dataflow_worker/shuffle_operations.py\", line 261, in dataflow_worker.shuffle_operations.BatchGroupAlsoByWindowsOperation.process\r\n  File \"dataflow_worker/shuffle_operations.py\", line 268, in dataflow_worker.shuffle_operations.BatchGroupAlsoByWindowsOperation.process\r\n  File \"apache_beam/runners/worker/operations.py\", line 359, in apache_beam.runners.worker.operations.Operation.output\r\n  File \"apache_beam/runners/worker/operations.py\", line 221, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive\r\n  File \"apache_beam/runners/worker/operations.py\", line 718, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/worker/operations.py\", line 719, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/common.py\", line 1241, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 1306, in apache_beam.runners.common.DoFnRunner._reraise_augmented\r\n  File \"apache_beam/runners/common.py\", line 1239, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 587, in apache_beam.runners.common.SimpleInvoker.invoke_process\r\n  File \"apache_beam/runners/common.py\", line 1401, in apache_beam.runners.common._OutputProcessor.process_outputs\r\n  File \"apache_beam/runners/worker/operations.py\", line 221, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive\r\n  File \"apache_beam/runners/worker/operations.py\", line 718, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/worker/operations.py\", line 719, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/common.py\", line 1241, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 1306, in apache_beam.runners.common.DoFnRunner._reraise_augmented\r\n  File \"apache_beam/runners/common.py\", line 1239, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 587, in apache_beam.runners.common.SimpleInvoker.invoke_process\r\n  File \"apache_beam/runners/common.py\", line 1401, in apache_beam.runners.common._OutputProcessor.process_outputs\r\n  File \"apache_beam/runners/worker/operations.py\", line 221, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive\r\n  File \"apache_beam/runners/worker/operations.py\", line 718, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/worker/operations.py\", line 719, in apache_beam.runners.worker.operations.DoOperation.process\r\n  File \"apache_beam/runners/common.py\", line 1241, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 1321, in apache_beam.runners.common.DoFnRunner._reraise_augmented\r\n  File \"/usr/local/lib/python3.8/site-packages/future/utils/__init__.py\", line 446, in raise_with_traceback\r\n    raise exc.with_traceback(traceback)\r\n  File \"apache_beam/runners/common.py\", line 1239, in apache_beam.runners.common.DoFnRunner.process\r\n  File \"apache_beam/runners/common.py\", line 587, in apache_beam.runners.common.SimpleInvoker.invoke_process\r\n  File \"apache_beam/runners/common.py\", line 1374, in apache_beam.runners.common._OutputProcessor.process_outputs\r\n  File \"/usr/local/lib/python3.8/site-packages/apache_beam/io/gcp/experimental/spannerio.py\", line 550, in process\r\n    for row in read_action(element['partitions']):\r\n  File \"/usr/local/lib/python3.8/site-packages/google/cloud/spanner_v1/streamed.py\", line 143, in __iter__\r\n    self._consume_next()\r\n  File \"/usr/local/lib/python3.8/site-packages/google/cloud/spanner_v1/streamed.py\", line 116, in _consume_next\r\n    response = six.next(self._response_iterator)\r\n  File \"/usr/local/lib/python3.8/site-packages/google/cloud/spanner_v1/snapshot.py\", line 45, in _restart_on_unavailable\r\n    for item in iterator:\r\n  File \"/usr/local/lib/python3.8/site-packages/google/api_core/grpc_helpers.py\", line 116, in next\r\n    six.raise_from(exceptions.from_grpc_error(exc), exc)\r\n  File \"\u003cstring\u003e\", line 3, in raise_from\r\ngoogle.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded [while running 'Read from Spanner/Read From Partitions']\r\n```\r\nFrom my understanding this error comes from the `ReadFromSpanner` operation as it's workers have timed out.\r\n\r\nTo solve this I have tried the following:\r\n\r\n- Changed the num_workers and disk_size_gb and added the `--experiments=shuffle_mode=service` flag as suggested in [Google's Common Error Guidance](https://cloud.google.com/dataflow/docs/guides/common-errors#tsg-rpc-timeout)\r\n- Changed the Machine Type from `n1-standard-1` up to `n1-standard-32`\r\n- My latest code is attached below. I am including Transformation for simple data wrangling in the rows.\r\n\r\n```\r\n \"\"\"Set pipeline arguments.\"\"\"\r\n    options = PipelineOptions(\r\n        region=RUNNER_REGION,\r\n        project=RUNNER_PROJECT_ID,\r\n        runner=RUNNER,\r\n        temp_location=TEMP_LOCATION,\r\n        job_name=JOB_NAME,\r\n        service_account_email=SA_EMAIL,\r\n        setup_file=SETUP_FILE_PATH,\r\n        disk_size_gb=500,\r\n        num_workers=10,\r\n        machine_type=\"n1-standard-2\",\r\n        save_main_session=True)\r\n\r\n    \"\"\"Build and run the pipeline.\"\"\"\r\n        with beam.Pipeline(options=options) as p:\r\n            (p\r\n             | \"Read from Spanner\" \u003e\u003e ReadFromSpanner(SPANNER_PROJECT_ID, SPANNER_INSTANCE_ID, SPANNER_DB, sql=QUERY)\r\n             | \"Transform elements into dictionary\" \u003e\u003e beam.ParDo(Transformation)\r\n             | \"Write new records to BQ\" \u003e\u003e WriteToBigQuery(\r\n                 BIGQUERY_TABLE,\r\n                 schema=SCHEMA,\r\n                 write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND,\r\n                 create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED)\r\n                 ) \r\n```\r\nA potential solution is to edit the timeout control; I have seen this being available in Java but not in Python. How can I edit timeout control in Python or is there any other solution to this issue?\r\n","author":{"url":"https://github.com/sebastian-montero","@type":"Person","name":"sebastian-montero"},"datePublished":"2021-03-10T17:44:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/261/python-spanner/issues/261"}

route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:57d327dd-4919-06ed-44ef-ca5fa7f91a04
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD3A2:12F35E:1F642E2:2D01439:6A4F895D
html-safe-nonce2efdedbd92e7880af5dcd254762f34fde8bda2b73a200a060a47e09bde817f69
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0EyOjEyRjM1RToxRjY0MkUyOjJEMDE0Mzk6NkE0Rjg5NUQiLCJ2aXNpdG9yX2lkIjoiNDMyOTQwNDYwMzI2MDk2MzE2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac33deb9b6aac1f21240fb2b689927eb14af73d107ddbf4fe72c10c46d3eec1b1e
hovercard-subject-tagrepository:226992630
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/googleapis/python-spanner/issues/261
twitter:imagehttps://opengraph.githubassets.com/3cc54f98105166e25e3650050536d50853f8444ec91dab7fd33ced5df2899749/googleapis/python-spanner
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3cc54f98105166e25e3650050536d50853f8444ec91dab7fd33ced5df2899749/googleapis/python-spanner
og:image:altThis library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner - Issue · googleapis/python-spanner
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-cache
go-importgithub.com/googleapis/python-spanner git https://github.com/googleapis/python-spanner.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992630
octolytics-dimension-repository_nwogoogleapis/python-spanner
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992630
octolytics-dimension-repository_network_root_nwogoogleapis/python-spanner
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
release4b249b445842943ed31549e027f57a8ade9881ed
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-spanner/issues/261#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-spanner%2Fissues%2F261
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/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/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/enterprise/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-spanner%2Fissues%2F261
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%2Fissues%2Fshow&source=header-repo&source_repo=googleapis%2Fpython-spanner
Reloadhttps://github.com/googleapis/python-spanner/issues/261
Reloadhttps://github.com/googleapis/python-spanner/issues/261
Reloadhttps://github.com/googleapis/python-spanner/issues/261
Please reload this pagehttps://github.com/googleapis/python-spanner/issues/261
googleapis https://github.com/googleapis
python-spannerhttps://github.com/googleapis/python-spanner
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Fork 103 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Star 155 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Code https://github.com/googleapis/python-spanner
Issues 0 https://github.com/googleapis/python-spanner/issues
Pull requests 0 https://github.com/googleapis/python-spanner/pulls
Actions https://github.com/googleapis/python-spanner/actions
Projects https://github.com/googleapis/python-spanner/projects
Security and quality 0 https://github.com/googleapis/python-spanner/security
Insights https://github.com/googleapis/python-spanner/pulse
Code https://github.com/googleapis/python-spanner
Issues https://github.com/googleapis/python-spanner/issues
Pull requests https://github.com/googleapis/python-spanner/pulls
Actions https://github.com/googleapis/python-spanner/actions
Projects https://github.com/googleapis/python-spanner/projects
Security and quality https://github.com/googleapis/python-spanner/security
Insights https://github.com/googleapis/python-spanner/pulse
#278https://github.com/googleapis/python-spanner/pull/278
Add custom retry and timeout options for partition reads and querieshttps://github.com/googleapis/python-spanner/issues/261#top
#278https://github.com/googleapis/python-spanner/pull/278
https://github.com/larkee
api: spannerIssues related to the googleapis/python-spanner API.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22api%3A%20spanner%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/sebastian-montero
sebastian-monterohttps://github.com/sebastian-montero
on Mar 10, 2021https://github.com/googleapis/python-spanner/issues/261#issue-828106798
Google's Common Error Guidancehttps://cloud.google.com/dataflow/docs/guides/common-errors#tsg-rpc-timeout
larkeehttps://github.com/larkee
api: spannerIssues related to the googleapis/python-spanner API.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22api%3A%20spanner%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%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.