Serialisation fails with pydantic 2.14: wrap serialisers pass SerializationInfo as index_key
@hugohills-regnosys đang làm issue này rồi.
Từ ngày 14/10/2026.
- #46 của @hugohills-regnosys — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Hai lời gọi có vấn đề nằm trong src/rune/runtime/base_data_class.py ở dòng 110, nơi gọi serializer(self, info), và trong src/rune/runtime/metadata.py ở dòng 692, nơi gọi handler(obj.enum_instance, info). Hãy tái hiện lỗi bằng đoạn mã trong issue trên pydantic 2.14.1, sau đó sửa cả hai lời gọi để handler chỉ nhận giá trị. Công việc hoàn thành khi đoạn mã in ra JSON mong đợi và 15 bài kiểm tra đang lỗi trong bộ kiểm thử của repo đều pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
With pydantic 2.14, serialising any BaseDataClass fails. pyproject.toml allows any pydantic >=2.10.3, so a fresh install gets 2.14.1 and breaks.
Two wrap serialisers pass pydantic's SerializationInfo as the second positional argument of the handler they are given. That argument is index_key (def __call__(self, input_value, index_key: int | str | None = None, /)). Up to 2.13, pydantic accepted whatever was passed there; 2.14 checks its type:
src/rune/runtime/base_data_class.py:110:serializer(self, info)src/rune/runtime/metadata.py:692:handler(obj.enum_instance, info)
Steps to Reproduce:
pip install rune.runtime==2.2.1 pydantic==2.14.1- Run:
from rune.runtime.base_data_class import BaseDataClass class A(BaseDataClass): value: int | None = None print(A(value=1).rune_serialize())
Expected Result:
{"@type":"__main__","@model":"__main__","@version":"0.0.0","value":1}, which is what pydantic 2.12.5 and 2.13.4 produce.
Actual Result:
pydantic_core._pydantic_core.PydanticSerializationError: Error serializing to JSON: PydanticSerializationError: Error calling function `_serialize_refs`: TypeError: 'index_key' is expected to be an integer or a string, got 'SerializationInfo(include=None, exclude=None, context=None, mode='json', by_alias=False, exclude_unset=True, exclude_defaults=True, exclude_none=False, exclude_computed_fields=False, round_trip=False, serialize_as_any=False)'
On main with pydantic 2.14.1, 15 tests in this repo's suite fail this way.
Environment:
rune.runtime 2.2.1 and main (b0fa1cd), pydantic 2.14.1 / pydantic-core 2.50.1, Python 3.12, macOS.
Additional Context:
The fix is to call the handler with the value only. The rune-python-generator Python unit tests (features/serialization/) hit the same error, because generated packages also leave pydantic unpinned.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 3
- Merge trung bình
- 8 giờ 25 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của finos/rune-python-runtime
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
finos/rune-python-runtime#43 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
finos/rune-python-runtime#42 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
finos/rune-python-runtime#27 ·
-
`typeAlias` missing features.Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
finos/rune-python-runtime#16 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
finos/rune-python-runtime#15 · 1 bình luận ·
Tất cả issue của finos/rune-python-runtime
Issue tương tự
-
vis.image() reports "Unsupported number of image channels: 224" for an HxWxC imageCó thể đã có người làm @piyush182004 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fossasia/visdom#1997 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Byse new domainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Gujal00/ResolveURL#1525 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: LangGraph Store sync put bypasses namespace validationCó thể đã có người làm @ktz03 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
volcengine/OpenViking#6050 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
hummingbot/condor#283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
githubnext/gh-aw-workshop#4571 ·
Maintainer thường phản hồi trong vòng 1 ngày