deephaven / streamlit-deephaven

Deephaven Streamlit custom component
MIT License
1 stars 3 forks source link

Past streamlit script runs remain in the query scope #9

Closed niloc132 closed 3 months ago

niloc132 commented 4 months ago

Using streamlit's features to change state and re-run a script, or editing script files and letting streamlit re-run, causes new variables to be created in the deephaven scope (in the __main__.__dict__ object). Later runs do not clean out old values, resulting in a long list of variables: screenshot883

In theory specifying object_id= would let the user keep replacing the same name with new values, but it seems to not actually force the iframes to refresh (though the new object is available in scope, confirmed by checking the http://localhost:10000/ide/ panels list).

mofojed commented 4 months ago

Need to make sure the main dict that we add the object_id to is the same on each streamlit re-run. Also need to clear the old objects from a previous run.