deephaven / streamlit-deephaven

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

DEV_MODE doesn't allow edits to the source file while running #7

Closed niloc132 closed 3 months ago

niloc132 commented 4 months ago

This package is deceptively simple, seeming to show that a single source file can contain the implementation to talk to Deephaven and the browser client, as long as the if DEV_MODE: block at the end contains your own source. However, if a user runs streamlit on this code with dev mode enabled, and tries to use streamlit's own re-run code, the __main__ import will run again to ingest changes, and any newly created objects will not be available to DH clients (including the browser).

Two simple proposed fixes:

kzk2000 commented 3 months ago

@jnumainville this is a pretty awesome cleanup of the logic - very cool!