Repository navigation
fix: preserve custom context containing large integers - #508
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
A sufficiently large positive or negative integer in
report_message(..., extra_data=...)causes the default, unbatched serializer to replace the entire custom context dictionary with"<class 'dict'>", losing neighboring fields too.Return integers directly before the floating-point NaN/infinity checks. Python can JSON-encode these integers; converting them to float for
math.isnan/math.isinfraisesOverflowError. Preserve existing finite-float and non-finite labels.Type of change
Related issues
Fixes #507
Validation
report_messageAPI. Batched-mode, ordinary numeric, boolean, NaN and infinity cases provide controls.test_report_exception_with_same_exception_as_cause, involving request-context state. Those baseline failures are not fixed here.transform_custom); verified against unchanged upstream. No new diagnostic introduced.git diff --checkpasses. Python 3.12; no full Python/framework version matrix run.Checklists
AI assistance: OpenAI Codex investigated, implemented, tested, and drafted this PR. Human verification is not claimed.