When you use an IDE debugger with this code, it can’t get a Session ID from the IDE itself, so you get this message:
" session_id = get_report_ctx().session_id
AttributeError: ‘NoneType’ object has no attribute ‘session_id’
"
I understand why we get this error, but what is the solution? How do we debug our code using the debugger when our local IDE can’t generate a sesion_id?
Hello @euler, if you have some data that must be cleared every run, the best way to do it is to keep them out of the session state I guess. Could you describe more precisely your usecase?
Hello @ksxx, unfortunately it’s not possible to change widget values programmatically for now. This session state doesn’t support it, and I don’t know any that does.
If you’re still encountering this issue,you could maybe use @thiago’s SessionState which does not use any hashing mechanism. My implementation is mostly useful if you want to bind widget values to session state variables.
I tried to set the page config but an error came out stated that I can only call it once. I suspect it’s probably due to how multiple app structure calling it. Is there any hack around this? @okld
StreamlitAPIException : set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.