PYTHON-968: Support IS NOT NULL operator in cqlengine #942
Conversation
mambocab
left a comment
There was a problem hiding this comment.
I've pushed a few small commits -- go ahead and squash into yours, just for history readability. The nit can be ignored if you like, I was just wondering if this could be sped up at all.
The caveat to all this is that I don't understand the update_context or get_context_size methods at all, so I'm just trusting that the tests catch any problems there would be with that.
|
|
||
|
|
||
| class TestIsNotNull(BaseCassEngTestCase): | ||
| def test_is_not_null_to_cql(self): |
There was a problem hiding this comment.
nit: Could this be a unit test?
There was a problem hiding this comment.
It definitely can, but we don't have unit tests for cqlengine, so I figured at some point we didn't want to create a new folder just for a few tests. They don't start C* so they don't add more time to the run for being there.
If we moved them to unit I'd do so in a future PR
There was a problem hiding this comment.
👍 awesome. filed a low-priority ticket: https://datastax-oss.atlassian.net/browse/PYTHON-975
|
They track count of how many parameters have been processed because the way cqlengine builds the queries is: So each clause need to know how many parameters the clauses from before have taken so they can put the "0" or the "1" or the number that it corresponds to them. Since |
|
Ohhh, cool. Thanks for the explanation. |
|
Looks great, +1 for merging. |
|
Awesome, thank you for the review! |
|
|
||
| q = Automobile.objects.filter(model__like='%Civic%').allow_filtering() | ||
|
|
||
| :attr:`IS NOT NULL (IsNotNull(column_name)) <query.QueryOperator.IsNotNullOperator>` |
There was a problem hiding this comment.
This should probably point to the Clause and not the Operator. In this case, I think the Operator can't be used directly.
There was a problem hiding this comment.
That's correct, the clause has to be used for this case. I'll change it
No description provided.