Title: MySQL8: Issue with case-sensitivity in dicts returned from information_schema · Issue #818 · datajoint/datajoint-python · GitHub
Open Graph Title: MySQL8: Issue with case-sensitivity in dicts returned from information_schema · Issue #818 · datajoint/datajoint-python
X Title: MySQL8: Issue with case-sensitivity in dicts returned from information_schema · Issue #818 · datajoint/datajoint-python
Description: When setting as_dict=True, returned values are .upper() for information_schema tables in MySQL 8.0.21. Since dicts are case-sensitive, lower-case key will thrown KeyError. See: # MySQL 8.0.21 >>> res = dj.conn().query('SELECT constraint_...
Open Graph Description: When setting as_dict=True, returned values are .upper() for information_schema tables in MySQL 8.0.21. Since dicts are case-sensitive, lower-case key will thrown KeyError. See: # MySQL 8.0.21 >>> r...
X Description: When setting as_dict=True, returned values are .upper() for information_schema tables in MySQL 8.0.21. Since dicts are case-sensitive, lower-case key will thrown KeyError. See: # MySQL 8.0.21 >&...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/818
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MySQL8: Issue with case-sensitivity in dicts returned from information_schema","articleBody":"When setting `as_dict=True`, returned values are `.upper()` for `information_schema` tables in MySQL 8.0.21. Since dicts are case-sensitive, lower-case key will thrown `KeyError`. See:\r\n```python\r\n# MySQL 8.0.21\r\n\u003e\u003e\u003e res = dj.conn().query('SELECT constraint_name FROM information_schema.key_column_usage limit 3', as_dict=True).fetchall()\r\n\u003e\u003e\u003e res\r\n[{'CONSTRAINT_NAME': 'PRIMARY'}, {'CONSTRAINT_NAME': 'PRIMARY'}, {'CONSTRAINT_NAME': 'PRIMARY'}]\r\n\u003e\u003e\u003e res[0]['constraint_name']\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nKeyError: 'constraint_name'\r\n```\r\nSolution could be to `.lower()` all returned keys after query specifically from `information_schema.*`.\r\n\r\nAlso, this is a good note on the warnings thrown from `MySQL8` in docker i.e. `mbind: Operation not permitted`\r\nhttps://github.com/docker-library/mysql/issues/303","author":{"url":"https://github.com/guzman-raphael","@type":"Person","name":"guzman-raphael"},"datePublished":"2020-10-23T15:50:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/818/datajoint-python/issues/818"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f3a8edcb-4cfa-0b43-0ef7-d24980dbb33c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB72:8709C:91AE2F:C691B4:6A4D6E90 |
| html-safe-nonce | 71efdb13dd56dda798d21105196d3b70e11816d0d810562acaa330d7a693c3ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjcyOjg3MDlDOjkxQUUyRjpDNjkxQjQ6NkE0RDZFOTAiLCJ2aXNpdG9yX2lkIjoiNzY5NTA2OTExMjQ2MDczNDA5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 551aab894ad3d75d9a190d69d72f04e516a89f34d2c374e0553f4f64cd5570d8 |
| hovercard-subject-tag | issue:728329514 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/818/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7b7cfddb6539e98884390b9fd9bcc9581a95aebcc75aa4278cc3bd662d1867df/datajoint/datajoint-python/issues/818 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7b7cfddb6539e98884390b9fd9bcc9581a95aebcc75aa4278cc3bd662d1867df/datajoint/datajoint-python/issues/818 |
| og:image:alt | When setting as_dict=True, returned values are .upper() for information_schema tables in MySQL 8.0.21. Since dicts are case-sensitive, lower-case key will thrown KeyError. See: # MySQL 8.0.21 >>> r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | guzman-raphael |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width