Handling deferred attributes automatically
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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 lần theo service.orders.get_entities(), các thuộc tính điều hướng như Customers và hành vi hiện có của expand("Customers"). Xác định cách thuộc tính OData __deferred có thể kích hoạt việc tải theo yêu cầu trong khi vẫn bảo toàn API của entity; được xem là hoàn thành khi việc truy cập o.Customers cung cấp dữ liệu deferred một cách trong suốt mà không cần gọi expand một cách rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Right now if an entity has a navigation property, the object must be completely reloaded (as below) to load in deferred data in navigation properties. For example:
orders = service.orders.get_entities()
for o in orders:
do_some_stuff_with(o.Customers) # This is an empty list right now so nothing will get done.
# The data must be reloaded as per the below for anything to happen.
orders = service.orders.get_entities().expand("Customers")
I propose that we use the OData __deferred attribute to fire a request on demand to load these attributes in. This would allow the API to look like this:
orders = service.orders.get_entities()
for o in orders:
do_some_stuff_with(o.Customers) # Request is automatically made using the `__deferred` attribute which transparently offers the missing data back to the class.
WDYT: @filak-sap
- Ngôn ngữ chính
- Python
- Star
- 268
- Fork
- 100
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 SAP/python-pyodata
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SAP/python-pyodata#304 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SAP/python-pyodata#108 ·
-
chore
SAP/python-pyodata#302 · 1 người được giao ·
-
question
SAP/python-pyodata#294 · 1 bình luận · 1 người được giao ·
-
Incorrect escaping of path Đang mởbug
SAP/python-pyodata#282 · 2 bình luận · 1 người được giao ·
Tất cả issue của SAP/python-pyodata
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·