Repository navigation
[py] Reject null list elements in BiDi serialization inbound and outbound - #18240
Merged
cgoldberg merged 3 commits intoOct 28, 2026
Merged
Conversation
…ound In BiDi protocol serialization (ADR 17786 Decision 4), list elements must conform to their declared item type and cannot be null. Previously, _read_scalar skipped primitive type checks when an element was None, allowing inbound lists of primitives to accept nulls silently. Similarly, _validate_outbound_scalar returned early on None, allowing outbound lists of primitives, records, and enums to send null elements. Reject null list elements in both directions, raising BiDiSerializationError when encountering None in lists of primitives, records, or enums. Fixes #18193
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
AutomatedTester
approved these changes
Oct 27, 2026
cgoldberg
self-requested a review
October 28, 2026 01:07
4 of 5 tasks
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
Fixes part of #18193 (Python section).
In BiDi protocol serialization (ADR 17786 Decision 4), list elements must conform to their declared item type and cannot be null. Previously:
_read_scalarskipped primitive checks when an inbound element wasNone, allowing primitive lists to accept[None]silently._validate_outbound_scalarreturned early onNone, allowing outbound lists of primitives, records, and enums to sendNoneelements.This PR ensures
Nonelist elements are rejected in both directions with a descriptiveBiDiSerializationError.Motivation and Context
In accordance with ADR 17786 Decision 4 and tracking issue #18193:
Types of changes
Checklist