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

in extract code, check equality with IS instead of = for nulls #455

Merged
merged 1 commit into from
Aug 27, 2022

Conversation

fgregg
Copy link
Contributor

@fgregg fgregg commented Jul 19, 2022

sqlite "IS" is equivalent to SQL "IS NOT DISTINCT FROM"

closes #423

sqlite "IS" is equivalent to SQL "IS NOT DISTINCT FROM"

close simonw#423
@fgregg fgregg changed the title in extract code, check equality witH IS instead of = for nulls in extract code, check equality with IS instead of = for nulls Jul 19, 2022
@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #455 (1b35a92) into main (855bce8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #455   +/-   ##
=======================================
  Coverage   96.64%   96.64%           
=======================================
  Files           6        6           
  Lines        2566     2566           
=======================================
  Hits         2480     2480           
  Misses         86       86           
Impacted Files Coverage Δ
sqlite_utils/db.py 97.54% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 855bce8...1b35a92. Read the comment docs.

@simonw
Copy link
Owner

simonw commented Jul 20, 2022

Can you add a new test for this? Something derived from the example in #423 would work great.

@simonw
Copy link
Owner

simonw commented Aug 27, 2022

I did not know is worked against strings and integers and booleans!

https://latest.datasette.io/_memory?sql=select+1+is+1%2C+2.3+is+2.3%2C+true+is+true%2C+true+is+false%2C+%27dog%27+is+%27dog%27%2C+%27dog%27+is+%27cat%27%2C+null+is+null%2C+null+is+not+null

select 1 is 1, 2.3 is 2.3, true is true, true is false, 'dog' is 'dog', 'dog' is 'cat', null is null, null is not null
1 is 1 2.3 is 2.3 true is true true is false 'dog' is 'dog' 'dog' is 'cat' null is null null is not null
1 1 1 0 1 0 1 0

@simonw simonw merged commit c5f8a2e into simonw:main Aug 27, 2022
@simonw simonw mentioned this pull request Aug 27, 2022
simonw added a commit that referenced this pull request Aug 28, 2022
simonw added a commit that referenced this pull request Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.extract() doesn't set foreign key when extracted columns contain NULL value
2 participants