Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_group_by_composed test fail #21

Open
gijzelaerr opened this issue Sep 20, 2017 · 2 comments
Open

test_group_by_composed test fail #21

gijzelaerr opened this issue Sep 20, 2017 · 2 comments
Milestone

Comments

@gijzelaerr
Copy link
Collaborator

Traceback (most recent call last):
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/cursors.py", line 164, in execute
    block = self.connection.execute(query)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 135, in execute
    return self.command('s' + query + '\n;')
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 140, in command
    return self.mapi.cmd(command)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/mapi.py", line 244, in cmd
    raise exception(string)
pymonetdb.exceptions.OperationalError: 42000!syntax error, unexpected '+', expecting SCOLON in: "select count(some_table.id) as count_1, some_table.x + some_table.y as lx 
!from "


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_select.py", line 95, in test_group_by_composed
    [(1, 3), (1, 5), (1, 7)]
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_select.py", line 44, in _assert_result
    config.db.execute(select).fetchall(),
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2064, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/cursors.py", line 164, in execute
    block = self.connection.execute(query)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 135, in execute
    return self.command('s' + query + '\n;')
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 140, in command
    return self.mapi.cmd(command)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/mapi.py", line 244, in cmd
    raise exception(string)
sqlalchemy.exc.OperationalError: (pymonetdb.exceptions.OperationalError) 42000!syntax error, unexpected '+', expecting SCOLON in: "select count(some_table.id) as count_1, some_table.x + some_table.y as lx 
!from "
 [SQL: 'SELECT count(some_table.id) AS count_1, some_table.x + some_table.y AS lx \nFROM some_table GROUP BY some_table.x + some_table.y ORDER BY lx']
@gijzelaerr gijzelaerr added this to the 1.0 milestone Sep 20, 2017
@gijzelaerr gijzelaerr self-assigned this Sep 20, 2017
@gijzelaerr
Copy link
Collaborator Author

gijzelaerr commented Oct 18, 2017

it looks like sqlalchemy.select().group_by(expr) doesnt use the label of an expression, while order_by(expr) does where expr = (table.c.x + table.c.y).label('lx')

@gijzelaerr
Copy link
Collaborator Author

gijzelaerr added a commit that referenced this issue Oct 20, 2017
@gijzelaerr gijzelaerr modified the milestones: 1.0, 1.1 Oct 25, 2017
@gijzelaerr gijzelaerr removed their assignment Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant