okld / streamlit-elements

Create a draggable and resizable dashboard in Streamlit, featuring Material UI widgets, Monaco editor (Visual Studio Code), Nivo charts, and more!
MIT License
679 stars 77 forks source link

Add AttributeError to ElementsCallbackData.__getattr__ #10

Open sindrelothe opened 2 years ago

sindrelothe commented 2 years ago

From here: https://docs.python.org/3/reference/datamodel.html?highlight=__getattr__#object.__getattr

object.getattr(self, name) This method should either return the (computed) attribute value or raise an AttributeError

Right now the function throws a KeyError when it gets a wrong argument, which makes the streamit_elements components unusable with pickle, deepcopy and other standard python libraries because they expect ArgumentError