html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,issue,performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/186#issuecomment-710198162,https://api.github.com/repos/simonw/sqlite-utils/issues/186,710198162,MDEyOklzc3VlQ29tbWVudDcxMDE5ODE2Mg==,9599,2020-10-16T16:41:00Z,2020-10-16T16:41:00Z,OWNER,"Failing test:
```python
def test_extract_null_values(fresh_db):
fresh_db[""species""].insert({""id"": 1, ""species"": ""Wolf""}, pk=""id"")
fresh_db[""individuals""].insert_all(
[
{""id"": 10, ""name"": ""Terriana"", ""species"": ""Fox""},
{""id"": 11, ""name"": ""Spenidorm"", ""species"": None},
{""id"": 12, ""name"": ""Grantheim"", ""species"": ""Wolf""},
{""id"": 13, ""name"": ""Turnutopia"", ""species"": None},
{""id"": 14, ""name"": ""Wargal"", ""species"": ""Wolf""},
],
pk=""id"",
)
fresh_db[""individuals""].extract(""species"")
assert fresh_db[""species""].schema == (
""CREATE TABLE [species] (\n""
"" [id] INTEGER PRIMARY KEY,\n""
"" [species] TEXT\n""
"")""
)
assert fresh_db[""individuals""].schema == (
'CREATE TABLE ""individuals"" (\n'
"" [id] INTEGER PRIMARY KEY,\n""
"" [name] TEXT,\n""
"" [species_id] INTEGER,\n""
"" FOREIGN KEY(species_id) REFERENCES species(id)\n""
"")""
)
assert list(fresh_db[""species""].rows) == [
{""id"": 1, ""species"": ""Wolf""},
{""id"": 2, ""species"": ""Fox""},
]
assert list(fresh_db[""individuals""].rows) == [
{""id"": 10, ""name"": ""Terriana"", ""species_id"": 2},
{""id"": 11, ""name"": ""Spenidorm"", ""species_id"": None},
{""id"": 12, ""name"": ""Grantheim"", ""species_id"": 1},
{""id"": 13, ""name"": ""Turnutopia"", ""species_id"": None},
{""id"": 14, ""name"": ""Wargal"", ""species_id"": 1},
]
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",722816436,
https://github.com/simonw/sqlite-utils/issues/186#issuecomment-709706260,https://api.github.com/repos/simonw/sqlite-utils/issues/186,709706260,MDEyOklzc3VlQ29tbWVudDcwOTcwNjI2MA==,9599,2020-10-16T03:17:02Z,2020-10-16T03:17:17Z,OWNER,Actually I think this should be an option to `.extract()` which controls if nulls are extracted or left alone. Maybe called `extract_nulls=True/False`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",722816436,
https://github.com/simonw/sqlite-utils/issues/186#issuecomment-709706065,https://api.github.com/repos/simonw/sqlite-utils/issues/186,709706065,MDEyOklzc3VlQ29tbWVudDcwOTcwNjA2NQ==,9599,2020-10-16T03:16:22Z,2020-10-16T03:16:22Z,OWNER,Either way I think I'm going to need to add some SQL which uses `where a = b or (a is null and b is null)`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",722816436,
https://github.com/simonw/sqlite-utils/issues/186#issuecomment-709705885,https://api.github.com/repos/simonw/sqlite-utils/issues/186,709705885,MDEyOklzc3VlQ29tbWVudDcwOTcwNTg4NQ==,9599,2020-10-16T03:15:39Z,2020-10-16T03:15:39Z,OWNER,The alternative solution here would be that a single `null` value DOES get extracted. To implement this I would need to add some logic that uses `is null` instead of `=`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",722816436,
https://github.com/simonw/sqlite-utils/issues/186#issuecomment-709705624,https://api.github.com/repos/simonw/sqlite-utils/issues/186,709705624,MDEyOklzc3VlQ29tbWVudDcwOTcwNTYyNA==,9599,2020-10-16T03:14:39Z,2020-10-16T03:14:39Z,OWNER,"How should this work with extractions covering multiple columns?
If there's a single column then it makes sense that a `null` value would not be extracted into the lookup table, but would instead become stay as `null`.
For a multiple column extraction, provided at least one of those columns is not null It should map to a record in the lookup table. Only if ALL of the extracted columns are null should the lookup value stay null.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",722816436,