Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that session_state.filtered_state can handle missing metadata #3970

Merged
merged 1 commit into from Oct 27, 2021

Conversation

vdonato
Copy link
Collaborator

@vdonato vdonato commented Oct 26, 2021

It turns out that using self.items() in the filtered_state method
sometimes breaks in the case that both

  1. widget metadata is cleared (because the streamlit server was
    restarted or the cache+session_state was cleared)
  2. we receive the current state of a widget with no metadata from
    the frontend.

In this scenario, the code that we have in the for loop to guard against
this case doesn't help us because the KeyError is thrown in the call to
self.items()

Closes #3843

It turns out that using self.items() in the filtered_state method
sometimes breaks in the case that both

1. widget metadata is cleared (because the streamlit server was
   restarted or the cache+session_state was cleared)
2. we receive the current state of a widget with no metadata from
   the frontend.

In this scenario, the code that we have in the for loop to guard against
this case doesn't help us because the KeyError is thrown in the call to
self.items()

Closes streamlit#3843
@vdonato vdonato marked this pull request as ready for review October 26, 2021 00:50
@vdonato vdonato merged commit 097bcd4 into streamlit:develop Oct 27, 2021
@vdonato vdonato deleted the 3843/filtered-state-fix branch October 27, 2021 01:46
tconkling added a commit that referenced this pull request Nov 1, 2021
* develop:
  * Add ability to access secrets by attribute notation. (#3915)
  Update README (#3948)
  Ensure that session_state.filtered_state can handle missing metadata (#3970)
  Stop dev menu being accessed as a viewer (#3968)
  Implement fail loudly for Bokeh when Bokeh version does not match (2.4.1) (#3966)
  Bump jquery-ui from 1.12.1 to 1.13.0 in /frontend (#3971)
  Try using slightly newer Python 3.7 image (#3967)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot print session_state when starting the app
2 participants