Tryton Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(149)

Issue 42921002: python-sql: Add comparison predicates

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 months, 2 weeks ago by ced
Modified:
2 months, 1 week ago
Reviewers:
pokoli, reviewbot
Visibility:
Public.

Description

bug55

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -2 lines) Patch
M CHANGELOG View 1 chunk +1 line, -0 lines 0 comments Download
M sql/operators.py View 2 chunks +75 lines, -0 lines 10 comments Download
M sql/tests/test_operators.py View 2 chunks +71 lines, -2 lines 0 comments Download

Messages

Total messages: 7
ced
2 months, 2 weeks ago (2017-12-12 18:40:50 UTC) #1
reviewbot
flake8 OK URL: https://codereview.tryton.org/42921002
2 months, 2 weeks ago (2017-12-12 19:20:45 UTC) #2
pokoli
https://codereview.tryton.org/42921002/diff/1/sql/operators.py File sql/operators.py (right): https://codereview.tryton.org/42921002/diff/1/sql/operators.py#newcode209 sql/operators.py:209: if self.left is Null: the new "IS" operator can ...
2 months, 2 weeks ago (2017-12-13 15:35:23 UTC) #3
ced
https://codereview.tryton.org/42921002/diff/1/sql/operators.py File sql/operators.py (right): https://codereview.tryton.org/42921002/diff/1/sql/operators.py#newcode209 sql/operators.py:209: if self.left is Null: On 2017/12/13 15:35:23, pokoli wrote: ...
2 months, 2 weeks ago (2017-12-13 15:52:39 UTC) #4
pokoli
https://codereview.tryton.org/42921002/diff/1/sql/operators.py File sql/operators.py (right): https://codereview.tryton.org/42921002/diff/1/sql/operators.py#newcode209 sql/operators.py:209: if self.left is Null: On 2017/12/13 15:52:39, ced wrote: ...
2 months, 2 weeks ago (2017-12-13 16:05:32 UTC) #5
ced
https://codereview.tryton.org/42921002/diff/1/sql/operators.py File sql/operators.py (right): https://codereview.tryton.org/42921002/diff/1/sql/operators.py#newcode209 sql/operators.py:209: if self.left is Null: On 2017/12/13 16:05:32, pokoli wrote: ...
2 months, 2 weeks ago (2017-12-13 16:16:01 UTC) #6
ced
2 months, 1 week ago (2017-12-13 23:13:13 UTC) #7
https://codereview.tryton.org/42921002/diff/1/sql/operators.py
File sql/operators.py (right):

https://codereview.tryton.org/42921002/diff/1/sql/operators.py#newcode275
sql/operators.py:275: assert right in [None, True, False]
On 2017/12/13 16:16:01, ced wrote:
> On 2017/12/13 16:05:32, pokoli wrote:
> > On 2017/12/13 15:52:39, ced wrote:
> > > On 2017/12/13 15:35:23, pokoli wrote:
> > > > I think we should also support Null
> > > 
> > > I do not think, this is supported by the Equal.
> > 
> > Better to support it on Is operator (as it's what a user expect). 
> 
> I do not understand what you want to support?

To be clear, we have to make compromise between what Python developer and what
SQL developer will expect.
The special behavior of NULL make it strange for a Python developer, that's why
we have the trick to change "== Null" into "is NULL". Because "= NULL" will
always have the same result no matter the left part.
The Is operator is only useful to enforce comparison with Boolean value. So the
"IS NULL" is not useful to implement because we have "== Null" but in opposite
the "IS UNKNOWN" could be useful because it is like "IS NULL" but enforcing the
Boolean value.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld bc8b922