Question
Ivan Tioh · Apr 11, 2017

[Python-Cache Binding] Unable to set $List property with 2D Python array

It is possible to update Cache object property from Python using the following Python code, with import of intersys.pythonbind3:

my_object.set("my_property",["A","B","C"])

However, I am unable to save 2D %List with 2D Python array like the following:

my_object.set("my_property",[["A","B","C"],["1","2","3"]])

I am not sure whether this is Python-Cache bind flaw or design issue. Is there any alternative/ workaround to do the same for above?

0
0 267
Discussion (3)0
Log in or sign up to continue

Class my_class Extends %Persistent{

Property my_property As %List;

}

 

From Cache, I normally update my_property field with $lb($lb(...),$lb(...),...) data. So, I was expecting the following behaviors:

PythonCacheResult
[1,2,3]$lb(1,2,3)OK
[[1,2,3],[4,5,6]]$lb($lb(1,2,3),$lb(4,5,6))Error

Our current Python binding only supports one dimensional lists.

I don't know of a work-around.

Please contact the WRC and discuss an enhancement request.  Product Management will decide whether the enhancement request is approved, and if approved when scheduled.

Thanks,

Jonathan Levinson

Senior Software Developer

InterSystems.