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

Fix empty string comparisons on option types #1308

Merged
merged 7 commits into from
Nov 19, 2015
Merged

Fix empty string comparisons on option types #1308

merged 7 commits into from
Nov 19, 2015

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Nov 19, 2015

No description provided.

@cpcloud cpcloud self-assigned this Nov 19, 2015
@cpcloud cpcloud added this to the 0.9.0 milestone Nov 19, 2015
@cpcloud cpcloud added the bug label Nov 19, 2015
@cpcloud
Copy link
Member Author

cpcloud commented Nov 19, 2015

@llllllllll @kwmsmith this PR breaks the following test:

============================================================ FAILURES ============================================================
_______________________________________________________ test_scalar_coerce _______________________________________________________
blaze/expr/tests/test_scalar.py:258: in test_scalar_coerce
    assert scalar_coerce('?date', '') == None
E   assert datetime.date(2015, 11, 19) == None
E    +  where datetime.date(2015, 11, 19) = scalar_coerce('?date', '')

I think that a comparison such as t.date_column == '' should raise a TypeError. Thoughts?

@cpcloud
Copy link
Member Author

cpcloud commented Nov 19, 2015

Right now, t.date_column == '' would be equivalent to t.date_column == None

@llllllllll
Copy link
Member

I think this is correct behavior. I was actually suprised that comparisons with strings coerced to datetimes at all. I am onboard with changing the test and deprecating that behavior

cpcloud added a commit that referenced this pull request Nov 19, 2015
Fix empty string comparisons on option types
@cpcloud cpcloud merged commit 09e5fc9 into blaze:master Nov 19, 2015
@cpcloud cpcloud deleted the empty-string-sql branch November 19, 2015 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants