So this just started happening.... When I call the .toDict() method on Memory Tag, of value type "document" all of the Integers and Floats are cast as <type 'java.math.BigDecimal'>.
parsed = system.tag.readBlocking(["[default]SomeTag",])[0].value
parsed = parsed.toDict()
for key in parsed["chassis"]["abs"]["parameters"]:
print parsed["chassis"]["abs"]["parameters"][key], type(parsed["chassis"]["abs"]["parameters"][key])
I fail to see how converted values could make your script raise KeyErrors.
What you're printing is the values and their types, not the keys.
It could be written like this to make it clearer that you're not dealing with the keys:
for key, value in parsed["chassis"]["abs"]["parameters"].iteritems():
print value, type(value)
In my particular case, my team had imported the "ast" (abstract syntax tree) library for some of the scripting. The library had been purposely added thus removing the library import call stopped my INTs, FLOATs, ect. from being parsed incorrectly, or more precisely- stopped them from being parsed into unexpected python 'privatives'.
Hi Kevin, is there any updates on this ticket. Just came across the same error for a single value out of many to be cast to java.math.BigDecimal. The value was script written to a document memory tag, and the error occurred on an instance where I duplicated the tag to another folder. The value is 15.
Document tag - script written values, no errors.
Duplicate document tag - copy and paste of the above document tag, one of the values, 15, that were carried over is causing the type error.