Title: skip_duplicates=True silences all errors · Issue #347 · datajoint/datajoint-python · GitHub
Open Graph Title: skip_duplicates=True silences all errors · Issue #347 · datajoint/datajoint-python
X Title: skip_duplicates=True silences all errors · Issue #347 · datajoint/datajoint-python
Description: Now that I have sql_mode = "TRADITIONAL" enabled on our server (#344), mysql catches various errors, such as trying to enter values outside of an enum. However, if I insert a row with skip_duplicates=True, dj skips trying to insert dupli...
Open Graph Description: Now that I have sql_mode = "TRADITIONAL" enabled on our server (#344), mysql catches various errors, such as trying to enter values outside of an enum. However, if I insert a row with skip_duplicat...
X Description: Now that I have sql_mode = "TRADITIONAL" enabled on our server (#344), mysql catches various errors, such as trying to enter values outside of an enum. However, if I insert a row with ski...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/347
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"skip_duplicates=True silences all errors","articleBody":"Now that I have `sql_mode = \"TRADITIONAL\"` enabled on our server (#344), mysql catches various errors, such as trying to enter values outside of an enum. However, if I insert a row with `skip_duplicates=True`, dj skips trying to insert duplicate rows, but unfortunately, it also skips all other errors that mysql would otherwise raise. This is because `skip_duplicates=True` uses the mysql command:\r\n\r\n`INSERT IGNORE ...`\r\n\r\nat around line 146 in `base_relation.py`. Apparently, this converts all mysql errors to warnings:\r\n\r\nhttps://stackoverflow.com/questions/548541/insert-ignore-vs-insert-on-duplicate-key-update\r\n\r\nso the logic in `BaseRelation.insert()` needs to be changed. Looks like it was last changed in commit dcfa8a2cb9339caa26df3b199ef5514cba7c6319. Previously, at some point in 2015, it looks like there was explicit testing in Python for duplicates, here: https://github.com/datajoint/datajoint-python/pull/149/commits/a13831ffb35c8095e9199494b92c2513623d3336#diff-661ea2dd73d26214fc12cf0606680678R196\r\n\r\nI don't know if there's some other way to tell mysql to skip duplicates, while still raising all other errors. As suggested in the above stackoverflow post, maybe `INSERT...ON DUPLICATE KEY UPDATE` is a solution.","author":{"url":"https://github.com/mspacek","@type":"Person","name":"mspacek"},"datePublished":"2017-08-03T12:55:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/347/datajoint-python/issues/347"}
| 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:492b6769-2a67-4155-db2c-59b6e2a1eda5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D17E:776B8:19F89D:25FB84:6A4DFE77 |
| html-safe-nonce | 7d6e3a6743e75450ad90f6e3a7108ee6d27ac30f24ea667543666a3517b8a2fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTdFOjc3NkI4OjE5Rjg5RDoyNUZCODQ6NkE0REZFNzciLCJ2aXNpdG9yX2lkIjoiNjU1Mjc1NTI3MDgzNjk0NDUwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0bfad2dea67826028e1a41530dd6e6a1dbb8b2136076f79ebba9cf41a7cf2640 |
| hovercard-subject-tag | issue:247697056 |
| 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/347/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc126160b9331e685367fdeec1fc725dac5bffc9ec3e8f69c6a1ec2320d5475b/datajoint/datajoint-python/issues/347 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc126160b9331e685367fdeec1fc725dac5bffc9ec3e8f69c6a1ec2320d5475b/datajoint/datajoint-python/issues/347 |
| og:image:alt | Now that I have sql_mode = "TRADITIONAL" enabled on our server (#344), mysql catches various errors, such as trying to enter values outside of an enum. However, if I insert a row with skip_duplicat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mspacek |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| 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 | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width