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

Conversation

Projects
None yet
2 participants
@cpcloud
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

cpcloud commented Nov 19, 2015

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

cpcloud added some commits Nov 19, 2015

@llllllllll

This comment has been minimized.

Member

llllllllll commented Nov 19, 2015

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

Merge pull request #1308 from cpcloud/empty-string-sql
Fix empty string comparisons on option types

@cpcloud cpcloud merged commit 09e5fc9 into blaze:master Nov 19, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cpcloud cpcloud deleted the cpcloud:empty-string-sql branch Nov 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment