Skip to content

Conversation

@hacksparr0w
Copy link
Contributor

The _bake_output function in exposition.py expects the params argument to be a dict[str, Any] but the ASGI interface does not handle encoding, thus the parameters are passed in as dict[bytes, Any].

Signed-off-by: hack <hacksparr0w@protonmail.com>
Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would you be willing to write a test for this please? Or add enough type hinting that it would be caught by mypy.

Signed-off-by: hacksparr0w <hacksparr0w@protonmail.com>
@hacksparr0w
Copy link
Contributor Author

I isolated the bug into a test case. Codifying this into type hints would be non-trivial since the used parse_qs function from urllib.parse is not typed and returns Any.

Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@csmarchbanks csmarchbanks merged commit 9e3eb6c into prometheus:master Sep 3, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants