Title: Error with `.aggr()` in datajoint 0.13.X · Issue #944 · datajoint/datajoint-python · GitHub
Open Graph Title: Error with `.aggr()` in datajoint 0.13.X · Issue #944 · datajoint/datajoint-python
X Title: Error with `.aggr()` in datajoint 0.13.X · Issue #944 · datajoint/datajoint-python
Description: Bug Report Description When using the ... argument in table1.aggr(table2, ...) to retain all attributes from table1 the following error occurs: OperationalError: (1055, "'neuro_scan.scan.scanner' isn't in GROUP BY") Reproducibility MACOS...
Open Graph Description: Bug Report Description When using the ... argument in table1.aggr(table2, ...) to retain all attributes from table1 the following error occurs: OperationalError: (1055, "'neuro_scan.scan.scanner' i...
X Description: Bug Report Description When using the ... argument in table1.aggr(table2, ...) to retain all attributes from table1 the following error occurs: OperationalError: (1055, "'neuro_scan.scan.s...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/944
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error with `.aggr()` in datajoint 0.13.X","articleBody":"## Bug Report\r\n\r\n### Description\r\nWhen using the `...` argument in `table1.aggr(table2, ...)` to retain all attributes from `table1` the following error occurs: `OperationalError: (1055, \"'neuro_scan.scan.scanner' isn't in GROUP BY\")`\r\n\r\n### Reproducibility\r\n- MACOS Version 11.5\r\n- Python Version 3.7.9\r\n- MariaDB Version 10.5.6\r\n- MariaDB Deployment Strategy local-native\r\n- DataJoint Version 0.13.1\r\n- Error stack:\r\n\r\n```\r\nIn [4]: session=dj.create_virtual_module('neuro_session','neuro_session')\r\n\r\nIn [5]: scan=dj.create_virtual_module('neuro_scan','neuro_scan')\r\n\r\nIn [6]: scan.Scan()\r\nOut[6]: \r\n*subject *session_datet *scan_id scanner acq_software scan_notes \r\n+------------+ +------------+ +---------+ +------------+ +------------+ +------------+\r\ntest_scanimag 2020-06-09 17: 0 MINI2P_Imaging ScanImage \r\n (Total: 1)\r\n\r\nIn [7]: session.Session()\r\nOut[7]: \r\n*subject *session_datet\r\n+------------+ +------------+\r\ntest_scanimag 2020-06-09 17:\r\n\r\nIn [8]: session.Session.aggr(scan.Scan)\r\nOut[8]: \r\n*subject *session_datet\r\n+------------+ +------------+\r\ntest_scanimag 2020-06-09 17:\r\n (Total: 1)\r\n\r\nIn [9]: session.Session.aggr(scan.Scan,...)\r\nOut[9]: \r\n*subject *session_datet\r\n+------------+ +------------+\r\ntest_scanimag 2020-06-09 17:\r\n (Total: 1)\r\n\r\nIn [10]: scan.Scan.aggr(session.Session)\r\nOut[10]: \r\n*subject *session_datet *scan_id \r\n+------------+ +------------+ +---------+\r\ntest_scanimag 2020-06-09 17: 0 \r\n (Total: 1)\r\n\r\nIn [11]: scan.Scan.aggr(session.Session,...)\r\nOut[11]: ---------------------------------------------------------------------------\r\nOperationalError Traceback (most recent call last)\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj)\r\n 700 type_pprinters=self.type_printers,\r\n 701 deferred_pprinters=self.deferred_printers)\r\n--\u003e 702 printer.pretty(obj)\r\n 703 printer.flush()\r\n 704 return stream.getvalue()\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/IPython/lib/pretty.py in pretty(self, obj)\r\n 392 if cls is not object \\\r\n 393 and callable(cls.__dict__.get('__repr__')):\r\n--\u003e 394 return _repr_pprint(obj, self, cycle)\r\n 395 \r\n 396 return _default_pprint(obj, self, cycle)\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)\r\n 698 \"\"\"A pprint that just redirects to the normal repr function.\"\"\"\r\n 699 # Find newlines and replace them with p.break_()\r\n--\u003e 700 output = repr(obj)\r\n 701 lines = output.splitlines()\r\n 702 with p.group():\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/expression.py in __repr__(self)\r\n 527 :rtype: str\r\n 528 \"\"\"\r\n--\u003e 529 return super().__repr__() if config['loglevel'].lower() == 'debug' else self.preview()\r\n 530 \r\n 531 def preview(self, limit=None, width=None):\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/expression.py in preview(self, limit, width)\r\n 531 def preview(self, limit=None, width=None):\r\n 532 \"\"\" :return: a string of preview of the contents of the query. \"\"\"\r\n--\u003e 533 return preview(self, limit, width)\r\n 534 \r\n 535 def _repr_html_(self):\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/preview.py in preview(query_expression, limit, width)\r\n 11 if width is None:\r\n 12 width = config['display.width']\r\n---\u003e 13 tuples = rel.fetch(limit=limit + 1, format=\"array\")\r\n 14 has_more = len(tuples) \u003e limit\r\n 15 tuples = tuples[:limit]\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/fetch.py in __call__(self, offset, limit, order_by, format, as_dict, squeeze, download_path, *attrs)\r\n 191 else: # fetch all attributes as a numpy.record_array or pandas.DataFrame\r\n 192 cur = self._expression.cursor(\r\n--\u003e 193 as_dict=as_dict, limit=limit, offset=offset, order_by=order_by)\r\n 194 heading = self._expression.heading\r\n 195 if as_dict:\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/expression.py in cursor(self, offset, limit, order_by, as_dict)\r\n 517 sql += ' LIMIT %d' % limit + (' OFFSET %d' % offset if offset else \"\")\r\n 518 logger.debug(sql)\r\n--\u003e 519 return self.connection.query(sql, as_dict=as_dict)\r\n 520 \r\n 521 def __repr__(self):\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/connection.py in query(self, query, args, as_dict, suppress_warnings, reconnect)\r\n 300 cursor = self._conn.cursor(cursor=cursor_class)\r\n 301 try:\r\n--\u003e 302 self._execute_query(cursor, query, args, suppress_warnings)\r\n 303 except errors.LostConnectionError:\r\n 304 if not reconnect:\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/connection.py in _execute_query(cursor, query, args, suppress_warnings)\r\n 266 cursor.execute(query, args)\r\n 267 except client.err.Error as err:\r\n--\u003e 268 raise translate_query_error(err, query)\r\n 269 \r\n 270 def query(self, query, args=(), *, as_dict=False, suppress_warnings=True, reconnect=None):\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/datajoint/connection.py in _execute_query(cursor, query, args, suppress_warnings)\r\n 264 # suppress all warnings arising from underlying SQL library\r\n 265 warnings.simplefilter(\"ignore\")\r\n--\u003e 266 cursor.execute(query, args)\r\n 267 except client.err.Error as err:\r\n 268 raise translate_query_error(err, query)\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/cursors.py in execute(self, query, args)\r\n 146 query = self.mogrify(query, args)\r\n 147 \r\n--\u003e 148 result = self._query(query)\r\n 149 self._executed = query\r\n 150 return result\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/cursors.py in _query(self, q)\r\n 308 self._last_executed = q\r\n 309 self._clear_result()\r\n--\u003e 310 conn.query(q)\r\n 311 self._do_get_result()\r\n 312 return self.rowcount\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/connections.py in query(self, sql, unbuffered)\r\n 546 sql = sql.encode(self.encoding, \"surrogateescape\")\r\n 547 self._execute_command(COMMAND.COM_QUERY, sql)\r\n--\u003e 548 self._affected_rows = self._read_query_result(unbuffered=unbuffered)\r\n 549 return self._affected_rows\r\n 550 \r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/connections.py in _read_query_result(self, unbuffered)\r\n 773 else:\r\n 774 result = MySQLResult(self)\r\n--\u003e 775 result.read()\r\n 776 self._result = result\r\n 777 if result.server_status is not None:\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/connections.py in read(self)\r\n 1154 def read(self):\r\n 1155 try:\r\n-\u003e 1156 first_packet = self.connection._read_packet()\r\n 1157 \r\n 1158 if first_packet.is_ok_packet():\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/connections.py in _read_packet(self, packet_type)\r\n 723 if self._result is not None and self._result.unbuffered_active is True:\r\n 724 self._result.unbuffered_active = False\r\n--\u003e 725 packet.raise_for_error()\r\n 726 return packet\r\n 727 \r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/protocol.py in raise_for_error(self)\r\n 219 if DEBUG:\r\n 220 print(\"errno =\", errno)\r\n--\u003e 221 err.raise_mysql_exception(self._data)\r\n 222 \r\n 223 def dump(self):\r\n\r\n/opt/miniconda3/envs/workflow-calcium-imaging/lib/python3.7/site-packages/pymysql/err.py in raise_mysql_exception(data)\r\n 141 if errorclass is None:\r\n 142 errorclass = InternalError if errno \u003c 1000 else OperationalError\r\n--\u003e 143 raise errorclass(errno, errval)\r\n\r\nOperationalError: (1055, \"'neuro_scan.scan.scanner' isn't in GROUP BY\")\r\n```\r\n\r\n### Expected Behavior\r\nFrom my understanding, the `...` argument used in `table1.aggr(table2, ...)` should retain all attributes from `table1`.\r\n\r\nThank you!","author":{"url":"https://github.com/kabilar","@type":"Person","name":"kabilar"},"datePublished":"2021-08-16T18:53:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/944/datajoint-python/issues/944"}
| 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:77b23380-981a-74ac-a92a-0961046c5430 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA52:3F0C56:1063D11:17DDD5B:6A4E3835 |
| html-safe-nonce | 085d1520c63f7d03010b72be052fba901b9d245317fde40deec788ff6dceef51 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTUyOjNGMEM1NjoxMDYzRDExOjE3RERENUI6NkE0RTM4MzUiLCJ2aXNpdG9yX2lkIjoiODM1ODY1MDUyMzI4OTUzMjQ2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6e1b48017a7ee8c0b91f694b14f86ece46f57ef9bef23663470cdd46a8db4952 |
| hovercard-subject-tag | issue:972011754 |
| 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/944/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3bd76b11d1e19db131676e12b2c95959201ca513f1b7f817446330e14fffee12/datajoint/datajoint-python/issues/944 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3bd76b11d1e19db131676e12b2c95959201ca513f1b7f817446330e14fffee12/datajoint/datajoint-python/issues/944 |
| og:image:alt | Bug Report Description When using the ... argument in table1.aggr(table2, ...) to retain all attributes from table1 the following error occurs: OperationalError: (1055, "'neuro_scan.scan.scanner' i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kabilar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| 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 | 42a6d378d7587a44c93aca255096cd66b7c8eb2d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width