Allow PYSON Expression as key for PYSON In with dict object

issue10542
This commit is contained in:
Maxime Richez committed 2021-07-11 11:25:30 +02:00
1 parent cfe9544643
commit fd98976e7d
2 files changed
+9 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Allow PYSON Expression as key for PYSON In with dict object
* Support Binary field in CSV import/export
Version 6.0.0 - 2021-05-03
+8 -2
View File
@@ -485,11 +485,17 @@ class In(PYSON):
assert obj.types().issubset({dict, list}), \
'obj must be a dict or a list'
if obj.types() == {dict}:
assert isinstance(key, str), 'key must be a string'
if isinstance(key, PYSON):
assert key.types() == {str}, 'key must be a string'
else:
assert isinstance(key, str), 'key must be a string'
else:
assert isinstance(obj, (dict, list))
if isinstance(obj, dict):
assert isinstance(key, str), 'key must be a string'
if isinstance(key, PYSON):
assert key.types() == {str}, 'key must be a string'
else:
assert isinstance(key, str), 'key must be a string'
self._key = key
self._obj = obj