crxi / multipage_streamlit

MultiPage Streamlit
Other
16 stars 3 forks source link

'State' object has no attribute 'ns' #2

Closed dodoowang closed 2 years ago

dodoowang commented 2 years ago

I got Attribute error when tried to retieve saved state variable with state.get("x"):

  lib\site-packages\multipage_streamlit\state.py", line 31, in get
      key = self.ns + key
  AttributeError: 'State' object has no attribute 'ns'

It looks like get() in state.py has one typo:

    def get(self, key, default=None):
        key = self.ns + key  # --> problem fixed after I change state.ns to state._ns
        return self._saved.get(key, default)
crxi commented 2 years ago

Thanks for catching that @dodoowang! It is now fixed.

Hope you find this multipage implementation useful.