python-sql

Bug 67

classification
Title: Window functions are not append to select query for complex columns
Type: Severity:
Components: Versions:
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ced, smn
Priority: Keywords:

Created on 2020-07-31 14:18 by smn, last changed 2020-08-01 00:30 by smn.

Messages
msg105 (view) Author: [hidden] (smn) Date: 2020-07-31 14:18
The method _window_functions[1] checks if a column is a WindowFunction or Aggregate class. But it does not consider if there is a previous Cast(), or even if the column is a division and divisor is an Aggregate with Window.


[1] https://hg.tryton.org/python-sql/file/tip/sql/__init__.py#l508
msg106 (view) Author: [hidden] (ced) Date: 2020-07-31 15:38
I think it will be better to have the window function explicitly added to the query but keep the current discovery for backward compatibility.
msg107 (view) Author: [hidden] (smn) Date: 2020-07-31 21:05
>  think it will be better to have the window function explicitly added to the query

LGTM, that's the solution I made in a custom class.
msg108 (view) Author: [hidden] (smn) Date: 2020-08-01 00:30
Here is a codereview:
https://codereview.tryton.org/300231002
History
Date User Action Args
2020-08-01 00:30:48smnsetmessages: + msg108
2020-07-31 21:05:25smnsetmessages: + msg107
2020-07-31 15:38:49cedsetnosy: + ced
messages: + msg106
2020-07-31 14:18:29smncreate