[Possible Bug?] Issue sending params through to script

I’m a little confused on how binding works vs referencing to the same object through a script.

When binding to an object (in this case an array), the ‘value’ that gets sent to the transform script is an:
<type ‘array.array’>
which I can work with as i’d expect (aside from having to cast PyDocumentObjectAdapters as dicts)

Good output:

but when referencing it directly in a transform script i.e. self.view.params.tags, the type of it is:
<type ‘array.array’> but the object is surrounded by ‘array()’ and contains QVs

Bad output:

is this how it’s supposed to work? I assumed binding to vs referencing directly would send through as the same datatype, but that doesn’t seem to be the case

Hi Matthew,

This is indeed how the Script Transform is intended to work; a call to the transform function is currently stripping the values from the Qualified Values for convenience. I’ve notified our Training Department in order to highlight this in the documentation.

I’m unsure as to how you’re using PyDocumentObjectAdapter, but I would not think you should have to.


Hey Mitch,

If that is the case, is there a function I can send my dataset to that will strip the values in the same manner?

As for the PyDocumentObjectAdapter, I was using that to check if the object was of that type so I could cast it as a dict.

Thank you for your reply,

This automatic unwrapping is currently handled for single Qualified Values, arrays of Qualified Values, and map objects with String keys mapped to Qualified Values. It does not currently handle Dataset objects.