Table updates don't happen immediately

If I edit a table in Python, and then if I access that same table in a different context (say a different function call) the edit has not been made.

For example,

def func():
  print(op('myDat').numRows) 
  myDat.deleteRow(0)  
  print(op('myDat').numRows)

If I call func twice starting with a dat with 2 rows I get:
2
1
2
1

I.e. within the function it realizes that a row has been deleted, but outside of that it seems to have “forgotten” that, until the next frame. I’m assuming it’s because there’s a local context where you can make edits to a table, but that those edits don’t get “committed” to the table until the next frame.

Is this the expected behavior?

If so, is there anyway to force an update within the same frame? I’m trying to use a table as a data store (for easy visibility) but I keep running into this issue. Trying to force a cook doesn’t work (I assume because it would force it to cook for the next frame).

1 Like

Hey @donaldr,

to help replicate this, how do you call the function func() on your end?

Cheers
Markus