opened
xflr6
username_0
`None` and bools rendered as literal (`IS DISTINCT FROM NULL/true/false`)

The sqlite dialect could render the operator(s) as `IS NOT ...`: SQLite lacks `IS DISTINCT FROM` but accepts non-booleans in `IS (NOT)`.
Add IS (NOT) DISTINCT FROM operator
issue
created
zzzeek
username_1
this needs an implementation in default_comparators.py as well; see match_op and notmatch_op for how those work, including negation.   Then take a look at test_operators -> MatchTest where we are testing string compilation as well as negation.
comment
created
xflr6
username_0
Does it need more than the two tuples in `operator_lookup` in default_comparators.py?
comment
created
zzzeek
username_1
mmm if the test is doing the right thing then that might be all it needs
comment
created
xflr6
username_0
Yes, works for me. What do you think about the sqlite workaround?
comment
created
zzzeek
username_1
took me awhile to understand that.  I think it's OK, I cant get a clear answer on what SQLite defines here looking at http://sqlite.org/datatype3.html but it appears to act like the distinct version elsewhere.
comment
created
xflr6
username_0
Sorry, I'll try to be more specific next time. I was unsure if such sql 'rewriting' would be too much magic for core (it should be equivalent though, given sqlite's 'dynamic' typing).

Maybe there should be a note on this: In the docstring of the operator or rather in the dialect docs (maybe you also want to take over and fill in docs/details to match the general style)?
comment
created
zzzeek
username_1
oh i understood what you were asking, I was trying to understand what "IS DISTINCT FROM" does that's different from "IS" :).   It is true the "SQL rewriting" thing is risky, but in this case it's a very special operator people normally aren't going to use and SQLite really seems to bundle "IS DISTINCT FROM" into their "IS" operator.    We can add a note to the docstring of the operator: "on databases where the IS operator supplies the same functionatliyy, e.g. sqlite, it will produce "IS"" / <same thing for IS NOT DISTINCT FROM"
comment
created
xflr6
username_0
Thanks, added.

I know :) (I should have added newline after my first sentence)
comment
created
zzzeek
username_1
Dear contributor -

This pull request is being moved to Gerrit, at https://gerrit.sqlalchemy.org/42, where it may be tested and reviewed more closely.  As such, the pull request itself is being marked "closed" or "declined", however your contribution is merely being moved to our central review system. Please register at https://gerrit.sqlalchemy.org#/register/ to send and receive comments regarding this item.
comment