Typed column metadata reads via RetrieveMetadataChanges (one request, no @odata.type cast round-trip)
Chưa có ai nhận issue này.
Đá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
- 55/100
Hướng nghiên cứu
Bắt đầu trong data/_odata.py và kiểm tra cast path hiện có của metadata, sau đó lần theo list_columns và get_column trong operations/tables.py cùng với async twin của chúng. Bổ sung unit coverage cho request shape, projection, criteria và typed mapping của RetrieveMetadataChanges, đồng thời cập nhật README và CHANGELOG. Hoàn tất khi typed reads trả về các thuộc tính như MaxLength hoặc MinValue/MaxValue trong một request, trong khi vẫn giữ cast path hiện có làm fallback.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Reading type-specific column properties over /EntityDefinitions is a two-step dance: first read the generic attribute to get AttributeType/@odata.type, then re-issue a second GET with a derived-type URL cast (/Attributes/Microsoft.Dynamics.CRM.StringAttributeMetadata) to project the typed fields. The SDK does exactly this today (e.g. _bulk_fetch_picklists, extra_select="@odata.type,AttributeType").
Context: what the .NET modern client gives for free
ServiceClient gets fully-typed, polymorphic AttributeMetadata derived objects back in one RetrieveEntity/RetrieveAllEntities call and the caller just downcasts (attr is StringAttributeMetadata s). No second request, no discriminator juggling.
Proposed change
Add a typed read path backed by the Web API RetrieveMetadataChanges function -- the closest Web-API analog to the .NET single-request typed retrieve. It returns derived typed attributes in one call and supports property projection (via the query's AttributeQuery.Properties), so callers get small, typed payloads without the cast round-trip.
cols = client.tables.list_columns("account", typed=True) # typed values, one request
col = client.tables.get_column("account", "emailaddress1", typed=True)
Why this does not need a platform change
Payload size is controlled by the query's property projection, so the platform "omit null fields" ask is not a blocker -- we simply project only the properties we need. (Note: the .NET client itself uses plain Retrieve* + a client cache rather than RetrieveMetadataChanges; for a Web-API client wanting small typed payloads, RetrieveMetadataChanges with projection is the better fit. Design discussion welcome.)
Touchpoints
data/_odata.py-- new_retrieve_metadata_changes(...)issuingGET RetrieveMetadataChanges(Query=@p1)?@p1={...}with anEntityQueryExpression+AttributeQuery.Propertiesprojection.operations/tables.py+ async twin --typed=Trueonlist_columns/get_column(keep the existing cast path as fallback).- Unit tests: request shape (projection, criteria) + typed mapping.
- README + CHANGELOG.
Acceptance
list_columns(typed=True)returns typed values (e.g.MaxLengthon string/memo,MinValue/MaxValueon int) in a single request, no@odata.typeURL cast.- Property projection limits the payload to requested properties.
Related
- #194 -- create-time column constraints (in progress).
- microsoft/Dataverse-skills#119 -- documents the current two-step typed-read workaround.
- Ngôn ngữ chính
- Python
- Star
- 60
- Fork
- 23
- Merge trung bình
- 13 giờ 53 phút
- Pull request đã merge (30 ngày)
- 3
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 microsoft/PowerPlatform-DataverseClient-Python
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
-
enhancement
microsoft/PowerPlatform-DataverseClient-Python#194 · 1 người được giao ·
-
microsoft/PowerPlatform-DataverseClient-Python#170 · 1 người được giao ·
-
bug
microsoft/PowerPlatform-DataverseClient-Python#166 · 1 bình luận · 1 người được giao ·
Tất cả issue của microsoft/PowerPlatform-DataverseClient-Python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·