René's URL Explorer Experiment


Title: Error in the Cloud Function MySQL example · Issue #2127 · GoogleCloudPlatform/python-docs-samples · GitHub

Open Graph Title: Error in the Cloud Function MySQL example · Issue #2127 · GoogleCloudPlatform/python-docs-samples

X Title: Error in the Cloud Function MySQL example · Issue #2127 · GoogleCloudPlatform/python-docs-samples

Description: In which file did you encounter the issue? master/functions/sql/mysql_sample.py Describe the issue Hi i think i found an issue in the mysql sample for cloud functions, specially on the connection creation: if not mysql_conn: try: mysql_c...

Open Graph Description: In which file did you encounter the issue? master/functions/sql/mysql_sample.py Describe the issue Hi i think i found an issue in the mysql sample for cloud functions, specially on the connection c...

X Description: In which file did you encounter the issue? master/functions/sql/mysql_sample.py Describe the issue Hi i think i found an issue in the mysql sample for cloud functions, specially on the connection c...

Opengraph URL: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error in the Cloud Function MySQL example","articleBody":"## In which file did you encounter the issue?\r\n\r\n_master/functions/sql/mysql_sample.py_\r\n\r\n## Describe the issue\r\nHi i think i found an issue in the mysql sample for cloud functions, specially on the connection creation:\r\n\r\n```\r\nif not mysql_conn:\r\n        try:\r\n            mysql_conn = pymysql.connect(**mysql_config)\r\n        except OperationalError:\r\n            # If production settings fail, use local development ones\r\n            mysql_config['unix_socket'] = f'/cloudsql/{CONNECTION_NAME}'\r\n            mysql_conn = pymysql.connect(**mysql_config)\r\n```\r\n\r\nOn the try side, it will try to connect to the database using the mysql_config dict, but it does not have neither a **host** nor **unix_socket** key:\r\n\r\n```\r\nmysql_config = {\r\n  'user': DB_USER,\r\n  'password': DB_PASSWORD,\r\n  'db': DB_NAME,\r\n  'charset': 'utf8mb4',\r\n  'cursorclass': pymysql.cursors.DictCursor,\r\n  'autocommit': True\r\n}\r\n```\r\nSo that line will most likely fail, on the except side it looks more correct, this adds the unix_socket key with the connection name, so the connection will most likely work. Even the comment on the _except_ part looks misplaced.\r\n\r\n`# If production settings fail, use local development ones`\r\n\r\nI think the except part needs to be on the try part, and the except needs to have the _localhost_ instead. As the postgresql example file (_master/functions/sql/postgres_sample.py_)\r\n\r\nIf I'm wrong please let me know, sorry for the inconvenience.\r\nThanks in advance!","author":{"url":"https://github.com/alejandrombc","@type":"Person","name":"alejandrombc"},"datePublished":"2019-04-29T19:08:54Z","url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3e005abd-884f-3401-e725-06b861707b4e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB282:EBFE7:28D06E:3702C3:6AFE1A99
html-safe-nonced3512efa7d6ee642b7197e52cfde57b542588e3717b13a45548b6fa198c24d50
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjgyOkVCRkU3OjI4RDA2RTozNzAyQzM6NkFGRTFBOTkiLCJ2aXNpdG9yX2lkIjoiMzI1NDczOTE2MjcxMDczOTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6c1c47fc320c0500193da5cee79f2484a5951dc721fd75d1cfd13c582b9a4f33
hovercard-subject-tagissue:438463087
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/GoogleCloudPlatform/python-docs-samples/2127/issue_layout
twitter:imagehttps://opengraph.githubassets.com/252f61637353b9970ff4f1a76d148354423a7b83a3b55f6c835bc00940d0b297/GoogleCloudPlatform/python-docs-samples/issues/2127
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/252f61637353b9970ff4f1a76d148354423a7b83a3b55f6c835bc00940d0b297/GoogleCloudPlatform/python-docs-samples/issues/2127
og:image:altIn which file did you encounter the issue? master/functions/sql/mysql_sample.py Describe the issue Hi i think i found an issue in the mysql sample for cloud functions, specially on the connection c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealejandrombc
hostnamegithub.com
expected-hostnamegithub.com
Noned0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9
turbo-cache-controlno-preview
go-importgithub.com/GoogleCloudPlatform/python-docs-samples git https://github.com/GoogleCloudPlatform/python-docs-samples.git
octolytics-dimension-user_id2810941
octolytics-dimension-user_loginGoogleCloudPlatform
octolytics-dimension-repository_id35065876
octolytics-dimension-repository_nwoGoogleCloudPlatform/python-docs-samples
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35065876
octolytics-dimension-repository_network_root_nwoGoogleCloudPlatform/python-docs-samples
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
releasefef3993a71fa20f7be8e167132fbf9619bc66e12
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fpython-docs-samples%2Fissues%2F2127
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fpython-docs-samples%2Fissues%2F2127
Sign uphttps://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=GoogleCloudPlatform%2Fpython-docs-samples
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
GoogleCloudPlatformhttps://github.com/GoogleCloudPlatform
python-docs-sampleshttps://github.com/GoogleCloudPlatform/python-docs-samples
Codehttps://github.com/GoogleCloudPlatform/python-docs-samples
Issues48 (48)https://github.com/GoogleCloudPlatform/python-docs-samples/issues
Pull requests199 (199)https://github.com/GoogleCloudPlatform/python-docs-samples/pulls
Actionshttps://github.com/GoogleCloudPlatform/python-docs-samples/actions
Wikihttps://github.com/GoogleCloudPlatform/python-docs-samples/wiki
Security and qualityhttps://github.com/GoogleCloudPlatform/python-docs-samples/security
Insightshttps://github.com/GoogleCloudPlatform/python-docs-samples/insights
https://github.com/GoogleCloudPlatform/python-docs-samples
New issuehttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
New issuehttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
#2486https://github.com/GoogleCloudPlatform/python-docs-samples/pull/2486
Error in the Cloud Function MySQL examplehttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#top
#2486https://github.com/GoogleCloudPlatform/python-docs-samples/pull/2486
https://github.com/kurtisvg
api: sql-componenthttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22api%3A%20sql-component%22
https://github.com/alejandrombc
alejandrombchttps://github.com/alejandrombc
on Apr 29, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#issue-438463087
sgreenberghttps://github.com/sgreenberg
pfritzschehttps://github.com/pfritzsche
laylasellshttps://github.com/laylasells
pfritzschehttps://github.com/pfritzsche
on Jun 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-2397776227
JustinBeckwithhttps://github.com/JustinBeckwith
triage meI really want to be triaged.https://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22triage%20me%22
🚨This issue needs some love.https://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22%3Arotating_light%3A%22
on Oct 3, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-2684988918
kurtisvghttps://github.com/kurtisvg
kurtisvghttps://github.com/kurtisvg
laylasellshttps://github.com/laylasells
on Oct 15, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-2714726423
kurtisvghttps://github.com/kurtisvg
on Oct 18, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-2725290898
Update functions/sql example to use more clear connection logic.https://github.com/GoogleCloudPlatform/python-docs-samples/commit/59fc01fe26cb383c216820ffbeafdac675c3aed5
https://docs.github.com/articles/closing-issues-via-commit-messages
59fc01fhttps://github.com/GoogleCloudPlatform/python-docs-samples/commit/59fc01fe26cb383c216820ffbeafdac675c3aed5
kurtisvghttps://github.com/kurtisvg
completedhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2486https://github.com/GoogleCloudPlatform/python-docs-samples/pull/2486
on Oct 18, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-2725411055
kurtisvghttps://github.com/kurtisvg
api: sql-componenthttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22api%3A%20sql-component%22
🚨This issue needs some love.https://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22%3Arotating_light%3A%22
triage meI really want to be triaged.https://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22triage%20me%22
on Feb 6, 2020https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127#event-3015689963
Sign up for freehttps://github.com/signup?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
Sign in to commenthttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2127
kurtisvghttps://github.com/kurtisvg
api: sql-componenthttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=state%3Aopen%20label%3A%22api%3A%20sql-component%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.