m-wrzr / streamlit-searchbox

Streamlit searchbox that dynamically updates and provides a list of suggestions based on a provided function
MIT License
203 stars 26 forks source link

TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'types.GenericAlias' #23

Closed DavidWalz closed 9 months ago

DavidWalz commented 9 months ago

Thank you for building this component!

I get an error when importing streamlit-searchbox 0.1.4 with python 3.9.1 due to the following type hint

Traceback (most recent call last):
    from streamlit_searchbox import st_searchbox
  File "...\streamlit_searchbox\__init__.py", line 43, in <module>
    def _list_to_options_py(options: list[Any] | list[tuple[str, Any]]) -> list[Any]:
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'types.GenericAlias'

cf. https://bugs.python.org/issue42233

m-wrzr commented 9 months ago

Hey, thanks for opening the issue.

Should be fixed in streamlit-searchbox==0.1.5 - can you maybe confirm it's working again for your Python version?

DavidWalz commented 9 months ago

Works. Thank you for the super quick fix!