-
Notifications
You must be signed in to change notification settings - Fork 24
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
Not working in streamlit 1.41.1? #45
Comments
Hi @arnabneogi86 ! Thanks for reaching out - I hope to be able to look at this asap. It looks as if you are working on a Windows environment. Have you tried managing the library using poetry as your package manager? |
For me in the given sample call, if the key is changed from an int to a string this error is resolved. |
Confirmed.
Deleting |
Fixes mstaal#45 where example code uses a int for key, but Streamlit 1.41+ wants string for key. This will now accept either int or string and keep examples working without having to change them everywhere.
I just submitted a PR with my simple fix for this issue. |
BTW, @mstaal this component is awesome! I tried a number of other ways to make SSO work and hit roadblocks in everything else. This component is dead simple and I got the demo working in under 5 mins! Now I just have to integrate it into my app Thanks! |
I'm using streamlit version 1.41.1
msal_streamlit_authentication 1.1.0
note: same code is working fine with streamlit 1.37
Getting error
Traceback (most recent call last):
File "", line 1, in
File "c:\git\prtdata-ui\venv\Lib\site-packages\msal_streamlit_authentication_init_.py", line 28, in msal_authentication
authenticated_user_profile = _component_func(
^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\components\v1\custom_component.py", line 58, in call
return self.create_instance(
^^^^^^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\runtime\metrics_util.py", line 409, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\components\v1\custom_component.py", line 220, in create_instance
return_value = marshall_component(dg, element)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\components\v1\custom_component.py", line 183, in marshall_component
computed_id = compute_and_register_element_id(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\elements\lib\utils.py", line 219, in compute_and_register_element_id
element_id = _compute_element_id(
^^^^^^^^^^^^^^^^^^^^
File "c:\git\prtdata-ui\venv\Lib\site-packages\streamlit\elements\lib\utils.py", line 158, in _compute_element_id
h.update(user_key.encode("utf-8"))
^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'encode'
The text was updated successfully, but these errors were encountered: