From 47cf55bdebfe3319d3426cc3eeafb0753872c499 Mon Sep 17 00:00:00 2001 From: viniciusdsmello Date: Mon, 16 Mar 2026 13:51:22 -0300 Subject: [PATCH] fix: handle by_alias=None for Pydantic 2.10+ compatibility 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. --- src/openlayer/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openlayer/_compat.py b/src/openlayer/_compat.py index 786ff42a..6fb60851 100644 --- a/src/openlayer/_compat.py +++ b/src/openlayer/_compat.py @@ -149,7 +149,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + by_alias=bool(by_alias) if by_alias is not None else False, ) return cast( "dict[str, Any]",