Title: Invalid enum values fail silently on insert() and insert1() · Issue #344 · datajoint/datajoint-python · GitHub
Open Graph Title: Invalid enum values fail silently on insert() and insert1() · Issue #344 · datajoint/datajoint-python
X Title: Invalid enum values fail silently on insert() and insert1() · Issue #344 · datajoint/datajoint-python
Description: It seems that invalid enum values do not raise an error in mysql + datajoint-python when inserting into a table. Here's a minimal example: import datajoint as dj schema = dj.schema('dj_mysql_test', locals()) @schema class Mouse(dj.Manual...
Open Graph Description: It seems that invalid enum values do not raise an error in mysql + datajoint-python when inserting into a table. Here's a minimal example: import datajoint as dj schema = dj.schema('dj_mysql_test',...
X Description: It seems that invalid enum values do not raise an error in mysql + datajoint-python when inserting into a table. Here's a minimal example: import datajoint as dj schema = dj.schema('dj_mysq...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/344
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invalid enum values fail silently on insert() and insert1()","articleBody":"It seems that invalid enum values do not raise an error in mysql + datajoint-python when inserting into a table. Here's a minimal example:\r\n\r\n```python\r\nimport datajoint as dj\r\n\r\nschema = dj.schema('dj_mysql_test', locals())\r\n\r\n@schema\r\nclass Mouse(dj.Manual):\r\n definition = '\\n'.join([\r\n \"m : varchar(128)\", # name\r\n \"----\",\r\n \"m_sex : enum('F', 'M', 'unknown')\"\r\n ])\r\n\r\nm = Mouse()\r\nm.insert1(dict(m='test1', m_sex='M'))\r\nm.insert1(dict(m='test2', m_sex='blarg')) # fails silently\r\nm.insert([dict(m='test3', m_sex='F'),\r\n dict(m='test4', m_sex='blarg')]) # fails silently\r\n\r\nprint(m.preview())\r\nprint('dj.__version__ == ', dj.__version__)\r\n```\r\nThis results in the following output:\r\n```\r\n*m m_sex \r\n+-------+ +-------+\r\ntest1 M \r\ntest2 \r\ntest3 F \r\ntest4 \r\n (4 tuples)\r\n\r\ndj.__version__ == 0.8.0\r\n```\r\nObviously, I'm using the default values for the various kwargs for `.insert()` and `.insert1()`:\r\n```python\r\nreplace=False, ignore_errors=False, skip_duplicates=False, ignore_extra_fields=False\r\n```\r\nMost relevantly, `ignore_errors=False`, yet no error is raised. Is this a known issue? When we try something like this on the same mysql server using datajoint-matlab, an error is raised, as it should be IMO.\r\n\r\n```\r\n$ mysql -V\r\nmysql Ver 14.14 Distrib 5.5.57, for debian-linux-gnu (x86_64) using readline 6.3\r\n```","author":{"url":"https://github.com/mspacek","@type":"Person","name":"mspacek"},"datePublished":"2017-07-31T12:38:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/344/datajoint-python/issues/344"}
| 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:8ef9be6b-1099-d382-b4b0-677e60cecfb7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A696:3E0D60:1191BE:18A903:6A4E6443 |
| html-safe-nonce | da7c39f78bf08a2b032251eb7f66a1b3881ddef3e03e5493baead955d687e6bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjk2OjNFMEQ2MDoxMTkxQkU6MThBOTAzOjZBNEU2NDQzIiwidmlzaXRvcl9pZCI6IjI5Mjc3Njk1MDk3MDcwMTUyMzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9c65f4c7e23541ca99034451c21f812afc6ebe50d2b0e270dee182ad78afd9d9 |
| hovercard-subject-tag | issue:246742037 |
| 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/344/issue_layout |
| twitter:image | https://opengraph.githubassets.com/583b7e5799ec0a2e0d8ebd28e5e15e62f54e056c235f0f99bb8b546dc71e409f/datajoint/datajoint-python/issues/344 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/583b7e5799ec0a2e0d8ebd28e5e15e62f54e056c235f0f99bb8b546dc71e409f/datajoint/datajoint-python/issues/344 |
| og:image:alt | It seems that invalid enum values do not raise an error in mysql + datajoint-python when inserting into a table. Here's a minimal example: import datajoint as dj schema = dj.schema('dj_mysql_test',... |
| 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 | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width