Skip to content

Conversation

@ittuann
Copy link
Member

@ittuann ittuann commented Nov 28, 2025

Purpose

The type of additional_headers is Dict[str, str] | None, but the argument of dict.update() does not accept None. As a result, directly calling dict.update(additional_headers) triggers a type checking error.

Although at runtime default_factory=dict ensures that additional_headers is initialized with an empty dictionary, so None is never actually passed in and no runtime error occurs, the type annotation is still problematic.
This PR adds an extra check for the empty-type case, eliminates the potential issue, and resolves the type checking error.

Remarks

PR introduces (a) breaking change(s): <yes/no>
no
PR introduces (a) deprecation(s): <yes/no>
no

@github-actions github-actions bot added the python Pull requests that update Python code label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants