COW proxies are not recognised in ComplexTypeMetaDataMixin.deserialize.
Chưa có ai nhận issue này.
Đá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
- 76/100
Hướng nghiên cứu
Issue xác định metadata.py và ComplexTypeMetaDataMixin.deserialize là điểm bắt đầu. Đọc phương thức đó và helper _unwrap_cow_proxy hiện có, sau đó chạy bài kiểm thử hồi quy được cung cấp cho Security.deserialize với proxy rune_cow. Công việc hoàn tất khi proxy được gỡ bọc trước khi dispatch và validator chấp nhận giá trị bên trong.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Steps to Reproduce:
- Write a Rune function that takes a complex-type parameter and uses it in a
constructor expression (e.g.set result -> field: param). - Call the generated Python function — rune_cow wraps every parameter in a
_COWObject before the function body runs. - pydantic calls the field's PlainValidator with the _COWObject proxy.
- Observe the exception.
Expected Result:
The COW proxy is transparently unwrapped and the underlying value is accepted
by the validator.
Actual Result:
PydanticCustomError is raised:
"Expected either or dict but got <class '_COWObject'>."
Environment:
rune-python-runtime 2.2.2, pydantic 2.14.1, Python 3.11
Additional Context:
The model-level _unwrap_cow_inputs validator unwraps the outer data dict but
does not unwrap individual field values before field validators run.
metadata.py ComplexTypeMetaDataMixin.deserialize tests isinstance(obj, cls)
and isinstance(obj, Reference), neither of which matches a _COWObject.
Fix: call _unwrap_cow_proxy(obj) at the top of deserialize before the dispatch
chain.
import pytest
from pydantic_core import PydanticCustomError
import finos._bundle
from finos.cdm.base.staticdata.asset.common.Security import Security
from rune.runtime.cow import rune_cow
def test_r2_cow_proxy_not_recognised_in_deserialize():
'''A COW-proxied Security instance passed to Security.deserialize raises
PydanticCustomError because isinstance(proxy, Security) is False.'''
security = Security.model_construct()
cow_security = rune_cow(security)
# The proxy is not an instance of Security, Reference or dict —
# deserialize falls through to the error branch.
with pytest.raises(PydanticCustomError):
Security.deserialize(cow_security, set())
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 4
- Merge trung bình
- 1 ngày 11 giờ
- 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 78/100
finos/rune-python-runtime#52 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
finos/rune-python-runtime#51 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
finos/rune-python-runtime#50 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
finos/rune-python-runtime#47 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
finos/rune-python-runtime#43 ·
Tất cả issue của finos/rune-python-runtime
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
fossasia/visdom-dev#69 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Frontend build fails with Frappe version-16: DataImport is no longer exported by @framework/uiĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG: PROD: v1.3.0-beta Onboarding Profile Picture Misaligns When Name Validation Error AppearsCó thể đã có người làm @RitikaSen27 đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/PictoPy#1647 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[oblt-aw][autodoc] Update workflow docs for gh-aw v0.92.5 and detector permission scopeCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày