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

Show error message if search query tests for NULL using comparison operators #299

Merged
merged 4 commits into from Jul 16, 2014
Merged

Show error message if search query tests for NULL using comparison operators #299

merged 4 commits into from Jul 16, 2014

Conversation

@mjfroehlich
Copy link
Contributor

@mjfroehlich mjfroehlich commented Mar 23, 2014

One of our API users made failing search queries testing for NULL using comparison operators.
A log message "To compare a value to NULL, use the is_null/is_not_null operators" would have saved me some time understanding what's going on.

@@ -145,6 +145,9 @@ def test_operators(self):
d = dict(filters=[dict(name='birth_date', op='is_not_null')])
result = search(self.session, self.Person, d)
assert result.count() == 1
d = dict(filters=[dict(name='birth_date', op='eq', val=None)])
assert_raises(TypeError, search, self.session, self.Person, d)

Copy link
Owner

@jfinkels jfinkels Jul 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this blank line.

Loading

@mjfroehlich
Copy link
Contributor Author

@mjfroehlich mjfroehlich commented Jul 16, 2014

Thanks for the feedback, implemented.

Loading

jfinkels added a commit that referenced this issue Jul 16, 2014
Show error message if search query tests for NULL using comparison operators
@jfinkels jfinkels merged commit 74304d1 into jfinkels:master Jul 16, 2014
1 check failed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants