-
Notifications
You must be signed in to change notification settings - Fork 828
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
Wrong ProxySettings type hints #1269
Labels
Comments
I reproduced the error as expected when declaring proxy_settings = ProxySettings(
server="http://localhost:8080", username=None, password=None
)
# results in a dict with these items:
# dict_items([('server', 'http://localhost:8080'), ('username', None), ('password', None)]) Note, that another workaround is: proxy_settings = ProxySettings(
server="http://localhost:8080"
)
# results in a dict with these items:
# dict_items([('server', 'http://localhost:8080')]) So, A clean fix to the problem is updating def locals_to_params(args: Dict) -> Dict:
copy = {}
for key in args:
if key == "self":
continue
if args[key] is not None:
copy[key] = args[key] if not isinstance(args[key], Dict) else locals_to_params(args[key])
return copy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
Code Snippet
Describe the bug
ProxySettings
declaration isNone
is not allowed forusername
andpassword
. This, however, works:The text was updated successfully, but these errors were encountered: