fix: handle by_alias=None for Pydantic 2.10+ compatibility#619
Merged
viniciusdsmello merged 1 commit intomainfrom Mar 16, 2026
Merged
fix: handle by_alias=None for Pydantic 2.10+ compatibility#619viniciusdsmello merged 1 commit intomainfrom
viniciusdsmello merged 1 commit intomainfrom
Conversation
Pydantic 2.10+ (pydantic-core 2.27+) rejects None for the by_alias parameter in model_dump(), raising TypeError. Coerce None to False to match the v1 fallback path behavior.
|
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage. Once credits are available, reopen this pull request to trigger a review. |
shah-siddd
approved these changes
Mar 16, 2026
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.
Summary
pydantic-core2.27+) rejectsNonefor theby_aliasparameter inmodel_dump(), raisingTypeError: argument 'by_alias': 'NoneType' object cannot be converted to 'PyBool'NonetoFalsein the v2 path to match the existing v1 fallback behavior on line 157Context
This broke the Openlayer SDK when used with LangFlow 1.5.0 (which ships with Pydantic 2.10.6). The error occurs during
_build_request→model_dump→model.model_dump(by_alias=None).Test plan
model_dump()works with Pydantic 2.10+ (by_alias no longer raises TypeError)