You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @droneshire
Thanks for reporting the issue. Sorry it took me a while to look at it.
I don't think Orjson is designed to have exactly the same interface as Python's built-in Json library. It seems the solution is to let the user still use the standard json library if they have to use parameters such as sort_keys.
Describe the bug
Exception is thrown when using the
sort_keys=True
kwarg when using theto_json()
method of adeepdiff.Deepdiff()
object.The bug is in the
serialization.py
code iforjson
is defined/used:The fix would seem to be to handle all of the supported kwargs and translate them to their respective orjson opt. I.e. add in the following lines:
To Reproduce
NOTE: Need the
orjson
import to be defined (I'm not sure what allows this to happen, but the bug is hidden behind theif orjson:
conditionalOtherwise can just do the following:
Expected behavior
diff.to_json()
should not choke on standard json.dumps() kwargs (e.g.sort_keys
)OS, DeepDiff version and Python version (please complete the following information):
deepdiff==7.0.1
The text was updated successfully, but these errors were encountered: