Skip to content

Commit 1562f26

Browse files
committed
fix: pydantic model should use .model_dump() instead of dict()
1 parent 5c5ccd5 commit 1562f26

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/aleph/sdk/client/authenticated_http.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ async def create_instance(
525525
)
526526

527527
message, status, response = await self.submit(
528-
content=content.dict(exclude_none=True),
528+
content=content.model_dump(exclude_none=True),
529529
message_type=MessageType.instance,
530530
channel=channel,
531531
storage_engine=storage_engine,

src/aleph/sdk/client/http.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ async def get_estimated_price(
462462
self,
463463
content: ExecutableContent,
464464
) -> PriceResponse:
465-
cleaned_content = content.dict(exclude_none=True)
465+
cleaned_content = content.model_dump(exclude_none=True)
466466
item_content: str = json.dumps(
467467
cleaned_content,
468468
separators=(",", ":"),

tests/unit/test_price.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async def test_get_program_price_valid():
1515
required_tokens=3.0555555555555556e-06,
1616
payment_type="superfluid",
1717
)
18-
mock_session = make_mock_get_session(expected.dict())
18+
mock_session = make_mock_get_session(expected.model_dump())
1919
async with mock_session:
2020
response = await mock_session.get_program_price("cacacacacacaca")
2121
assert response == expected

0 commit comments

Comments
 (0)