mindee / tawazi

A DAG Scheduler library written in pure python
https://mindee.github.io/tawazi/
Apache License 2.0
83 stars 5 forks source link

SetItem doesn't work when indexing #156

Open bashirmindee opened 1 year ago

bashirmindee commented 1 year ago

Write a method to support setting indexed value inside the DAG. for example: we currently can do the following:

from tawazi import xn, dag

@xn
def mydict(): return {"a": 1}
@dag
def pipe():
  val = mydict()
  return val["a"]

but we can't do the following:

from tawazi import xn, dag

@xn
def mydict(): return {"a": 1}
@dag
def pipe():
  val = mydict()
  val["b"] = 2   # will set a value on the UsageExecNode directly because __setitem__ isn't implemented
  return val["a"], val["b"]