mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-10-24 10:17:05 +02:00
fix: treat set/frozenset as JSON-storable types in types_for_column_types
This commit is contained in:
parent
85b1be10c8
commit
264510d3d7
2 changed files with 11 additions and 2 deletions
|
|
@ -102,3 +102,12 @@ def test_flatten(input, expected):
|
|||
)
|
||||
def test_dedupe_keys(input, expected):
|
||||
assert utils.dedupe_keys(input) == expected
|
||||
|
||||
|
||||
def test_types_for_column_types_set_maps_to_str():
|
||||
"""set and frozenset should be mapped to str for JSON storage, like list/tuple/dict"""
|
||||
result = utils.types_for_column_types({"tags": {set}})
|
||||
assert result["tags"] is str
|
||||
|
||||
result = utils.types_for_column_types({"tags": {frozenset}})
|
||||
assert result["tags"] is str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue