Skip to content

Commit 971ced6

Browse files
chore(internal): properly set __pydantic_private__
1 parent 4facbca commit 971ced6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/openlayer/_base_client.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
ModelBuilderProtocol,
6060
)
6161
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62-
from ._compat import model_copy, model_dump
62+
from ._compat import PYDANTIC_V2, model_copy, model_dump
6363
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
6464
from ._response import (
6565
APIResponse,
@@ -203,6 +203,9 @@ def _set_private_attributes(
203203
model: Type[_T],
204204
options: FinalRequestOptions,
205205
) -> None:
206+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
207+
self.__pydantic_private__ = {}
208+
206209
self._model = model
207210
self._client = client
208211
self._options = options
@@ -288,6 +291,9 @@ def _set_private_attributes(
288291
client: AsyncAPIClient,
289292
options: FinalRequestOptions,
290293
) -> None:
294+
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
295+
self.__pydantic_private__ = {}
296+
291297
self._model = model
292298
self._client = client
293299
self._options = options

0 commit comments

Comments
 (0)