-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Milestone
Description
Given an infinite intbitset,
intbitset(trailing_bits=True)and this SQLAlchemy type,
class IntBitSetType(types.TypeDecorator):
impl = types.BLOB
def process_bind_param(self, value, dialect):
if value is None:
return None
return intbitset(value).fastdump()
def process_result_value(self, value, dialect):
if value is None:
return None
return intbitset(value)calling dict() on an instance that contains it, raises this exception:
...
File "/home/gs-sis/.virtualenvs/invenio/src/invenio-checker/invenio_checker/views/admin.py", line 201, in get_tasks_data
rule_d = dict(rule)
File "/home/gs-sis/.virtualenvs/invenio/src/invenio/invenio/ext/sqlalchemy/utils.py", line 116, in todict
value = value.tolist()
File "intbitset.pyx", line 770, in intbitset.intbitset.tolist (intbitset/intbitset.c:12711)
File "intbitset.pyx", line 775, in intbitset.intbitset.tolist (intbitset/intbitset.c:12641)
OverflowError: It's impossible to retrieve a list of an infinite set
intbitset behaves reasonably here, but this conversion was not asked for. Why are these conversions forced in todict?