I suspect a breaking change related to "include_relationships=True" and schema.load() in version 1.4.1
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ UserSchema với marshmallow-sqlalchemy 1.4.1 và so sánh với 1.1.0, tập trung vào schema.load() khi include_relationships=True và dữ liệu quan hệ bị thiếu. Theo dõi nơi trường quan hệ trở thành bắt buộc; được xem là hoàn thành khi các trường quan hệ có thể lại được bỏ qua trong quá trình nạp mà không phát sinh lỗi validation do thiếu trường, và hành vi được báo cáo được bao phủ bởi một regression test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi ! I recently had to do some testing on my local for some portion of our code that's been running happily on staging. I didn't specify a version number for my local container instance, as such it pulled 1.4.1 which is the latest. I noticed that it seems to enforce implicitly defined fields (from the include_relationships=True option), during a schema.load() which I THINK isn't the desired or USUAL behavior.
Typically (in previous versions specifically 1.1.0 ) we've been able to deserialize into objects with schemas defined with the include_relationships option set to True - without having to provide values for relationship fields (which intuitively makes sense), however for some reason it's raising a Validation (Missing field) error on 1.4.1 . This behavior wasn't reproducable on 1.1.0 (not that I would know if this is on later versions in: 1.1.0 < version < 1.4.1 because we've not used any other up until my recent local testing which used 1.4.1).
class UserSchema(Base):
class Meta:
model = User
include_relationships=True # includes for example an 'address' relationship attr (could be something like a 'backref' or explicitly declared field on the sqlalchemy model)
include_fk = True
load_instance = True
# usage and expected behavior
schema = UserSchema(unknown='exclude', session=session)
user = schema.load(**data)
# returns <User> object
# Observed behavior
# .. same steps
# throws 'Missing data for required 'address' field - error'
- Ngôn ngữ chính
- Python
- Star
- 580
- Fork
- 105
- Merge trung bình
- 9 giờ 8 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 marshmallow-code/marshmallow-sqlalchemy
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Dependency DashboardĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
-
Don't set a field as required if it's read-onlyCó thể đã có người làm @CyberneticX-Tech đã nhận 64 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
marshmallow-code/marshmallow-sqlalchemy#580 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của marshmallow-code/marshmallow-sqlalchemy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
btclib-org/btclib#3062 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Run evals automatically in CIĐang mởarea:evals area:infra enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jse-avl/support-bot#4 · 1 bình luận ·
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
qte77/agentic-job-offer-to-application-kit#487 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
On a free-threaded build, `_decrypted` can report a ledger locked mid-sign as a damaged fileĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
btclib-org/btclib-wallet#801 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 94/100