jskrable
7 years agoNew Contributor III
Python Dictionary Conversion in Script Snap
Hello,
I am trying to run a python script in the script snap that mocks up some test data for unit testing pipelines. The script relies on python data types such as list and dictionary to iterate through the incoming JSON document and manipulate it.
However, the document coming in are of type java.util.LinkedHashMap. When trying to convert to a python dict using dict(in_doc), it doesn’t process the document into a dict correctly.
Initial googling returned a number of jython bug around this issue. Is there any workaround for this that I can implement?
You can see the script here: test-file-gen/snap-file-gen.py at master · jskrable/test-file-gen · GitHub
Thanks,
Jack