transit-python. Unhashable error with dictionary in set.

43 views
Skip to first unread message

Alex D'Amour

unread,
Mar 29, 2016, 3:28:56 PM3/29/16
to transit-format
I am trying to import transit-encoded data (encoded in a clojure environment) into Python using transit-python.

I get a "TypeError: unhashable type: 'dict'" when I attempt to do so. I tracked down the issue to a set that contains a dictionary. Here is a minimal example that raises the exception:

from transit.reader import Reader
import StringIO
y = Reader()
z = y.read(StringIO.StringIO("[\"~#set\",[[\"^ \",\"~:keyword\",[\"^ \",\"~:customers\",[\"^0\",[[\"^ \",\"~:domain\",\"foobar.com\"]]]]]]]"))

Is this expected behavior? Ideally, I think, dictionaries would be imported as frozendicts. Is there a simple workaround?

Thanks,
Alex

Ben Kamphaus

unread,
Mar 29, 2016, 3:43:40 PM3/29/16
to transit...@googlegroups.com
Hi Alex,

Yep, that's a bug - luckily easy to identify and fix. Now corrected on master: https://github.com/cognitect/transit-python -- so you can obtain via the repo if necessary. I'll include that fix in the next release/package as well.

Best,
Ben

--
You received this message because you are subscribed to the Google Groups "transit-format" group.
To unsubscribe from this group and stop receiving emails from it, send an email to transit-forma...@googlegroups.com.
To post to this group, send email to transit...@googlegroups.com.
Visit this group at https://groups.google.com/group/transit-format.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages