Skip to content

Possible incorrect type annotation for **kwargs in the Authenticate constructor. #287

Description

@FakeDocument

Streamlit Version

1.41.1

Streamlit Authenticator Version

0.4.2

Environment

Ubuntu, python 3.10.12

What happened?

Summary

Possible incorrect type annotation for **kwargs in the Authenticate constructor.

Details

In /views/authentication_view.py, the constructor of the Authenticate class includes the following parameter:

**kwargs: Optional[Dict[str, Any]]

However, this annotation seems problematic. **kwargs cannot be typed as a dictionary directly — doing so implies that a single dictionary is expected as the unpacked keyword arguments, which isn't valid Python typing. It would mean that this is acceptable:

Authenticate(credentials, some_key={"foo": bar})

But from context, that doesn't seem to be the intended usage.

The more appropriate and syntactically valid form would likely be:

**kwargs: Any

Suggestion

If this interpretation is correct, I’d be happy to open a PR to fix it.

Let me know what you think!

What did you expect to happen?

No response

Steps to reproduce

None.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions