Skip to content

Conversation

SlavaSkvortsov
Copy link
Contributor

@SlavaSkvortsov SlavaSkvortsov commented Sep 23, 2021

If an object contains "unprocessed" string the lib crashes

>>> from deepdiff import DeepHash
>>> DeepHash('unprocessed')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "venv/lib/python3.8/site-packages/deepdiff/deephash.py", line 151, in __init__
    self._hash(obj, parent=parent, parents_ids=frozenset({get_id(obj)}))
  File "venv/lib/python3.8/site-packages/deepdiff/deephash.py", line 410, in _hash
    result, counts = self.hashes[obj]
ValueError: not enough values to unpack (expected 2, got 0)

I understand that later this key is used to return unprocessed objects, but I think this approach is better because you can always grab unprocessed objects using the UNPROCESSED_KEY constant.

Also, I removed RESERVED_DICT_KEYS constant - I think it was useless.

@SlavaSkvortsov SlavaSkvortsov marked this pull request as ready for review September 23, 2021 09:50
@seperman seperman changed the base branch from master to dev October 12, 2021 23:02
@seperman
Copy link
Owner

@SlavaSkvortsov Thanks. That makes sense.

@seperman seperman merged commit c96e1ac into seperman:dev Oct 12, 2021
@seperman
Copy link
Owner

Hi @SlavaSkvortsov
DeepDiff 5.6.0 is released and it includes your PR.
Thank you for your contribution!

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.

2 participants