tables.update_column / update_columns: update existing column constraints (retrieve -> PUT + @odata.type) -- no metadata-write path exists today
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
Rechercherichtung
Beginne mit data/_odata.py und _odata_base.py::_attribute_payload und prüfe anschließend die Tabellenoperationen in operations/tables.py und aio/operations/async_tables.py. Verifiziere die Anwendung des Overrides und die ausgehende PUT-Anfrage in Unit-Tests, einschließlich des abgeleiteten @odata.type; aktualisiere die README und CHANGELOG wie erforderlich. Bestätige, dass die Implementierung das Override-Schema aus #194 verwendet und Verb sowie Discriminator intern hält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
client.tables can create, add_columns, and remove_columns, but there is no way to update an existing column's definition -- MaxLength, MinValue/MaxValue, RequiredLevel, DisplayName, Format, etc. Today a caller who needs to widen a text column or change a required level must drop to the raw Web API PUT EntityDefinitions({id})/Attributes({id}) and hand-build the payload, including the derived @odata.type discriminator.
This is also the only place the counter-intuitive PUT-not-PATCH metadata-update contract is exposed to users. Metadata updates go over PUT with merge semantics (partial payloads are honored), which reads like PATCH behavior on the PUT verb. The right fix is not a platform verb change (that is a long pole) -- it is to hide the verb inside the SDK so users never choose it.
Context: parity with the .NET modern client
Microsoft.PowerPlatform.Dataverse.Client.ServiceClient never hits this, because it rides the Organization Service message contracts (Execute(new UpdateAttributeRequest { Attribute = new StringAttributeMetadata { MaxLength = 4000 } })) -- a typed message, no HTTP verb. The Python SDK is Web-API-bound and cannot borrow those contracts, so it should own the retrieve -> modify -> PUT (+ @odata.type) sequence internally to give the same UX (typed fields in, no verb visible).
Proposed change (backward-compatible)
Add update_column (+ update_columns) that accepts the same dict override schema proposed in #194, so create and update share one spec shape:
client.tables.update_column("cfb_CustomerFeedback", "cfb_Comment",
{"max_length": 4000, "display_name": "Customer Comment"})
Internally: GET the existing typed attribute -> apply overrides -> PUT back with the correct derived @odata.type. Never expose PUT/PATCH/@odata.type to the caller.
Touchpoints
data/_odata.py-- new_update_attribute(retrieve-then-PUTwith@odata.type); reuse_odata_base.py::_attribute_payloadoverride-building from #194.operations/tables.py+aio/operations/async_tables.py-- newupdate_column/update_columns.- Unit tests: override application + correct verb /
@odata.typeon the outbound request. - README + CHANGELOG per repo maintenance rules.
Acceptance
update_column(..., {"max_length": 4000})issues aPUTtoEntityDefinitions({id})/Attributes({id})withMaxLength: 4000and the correct derived@odata.type.- Caller never passes a verb or
@odata.type. - Depends on / shares the override-spec schema from #194.
Related
- #194 -- create-time column constraints (in progress).
- microsoft/Dataverse-skills#119 -- documents the raw Web API metadata contract this method replaces.
- Vorherrschende Sprache
- Python
- Sterne
- 61
- Forks
- 25
- Ø Merge
- 13 Std. 53 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/PowerPlatform-DataverseClient-Python
-
Typed column metadata reads via RetrieveMetadataChanges (one request, no @odata.type cast round-trip)Evtl. vergeben @arorashivam96 hat das vor 5 Tagen übernommen. Offenenhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
-
feat: make pandas an optional dependencyEvtl. vergeben @ChaitanyaAIML-lab hat das vor 9 Tagen übernommen. Offenenhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
-
tables.create / add_columns cannot set column constraints (MaxLength, MinValue/MaxValue, Format, RequiredLevel, DisplayName)Evtl. vergeben @arorashivam96 hat das vor 14 Tagen übernommen. Offenbug
microsoft/PowerPlatform-DataverseClient-Python#194 · 1 zugewiesene Person ·
-
client.dataframe.get() only returns physical columns, not the full logical schemaEvtl. wieder frei @sagebree hat das vor 154 Tagen übernommen, und es ist kein Pull Request offen. Offen
microsoft/PowerPlatform-DataverseClient-Python#170 · 1 zugewiesene Person ·
-
`DisplayCollectionName` uses naive + "s" pluralization in tables.create()Evtl. wieder frei @abelmilash-msft hat das vor 102 Tagen übernommen, und es ist kein Pull Request offen. Offenbug
microsoft/PowerPlatform-DataverseClient-Python#166 · 1 Kommentar · 1 zugewiesene Person ·
Alle Issues in microsoft/PowerPlatform-DataverseClient-Python
Ähnliche Issues
-
needs-human needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
gke-labs/kube-agents#2400 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reusedEvtl. vergeben @sylvesterkaczmarek hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
google-deepmind/bsuite#56 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
LearningCircuit/local-deep-research#7206 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
chingu-voyages/V62-tier3-team-33#285 ·
Maintainer antworten meist innerhalb von 1 Tag