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
Acceptance
Related
Summary
client.tablescancreate,add_columns, andremove_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 APIPUT EntityDefinitions({id})/Attributes({id})and hand-build the payload, including the derived@odata.typediscriminator.This is also the only place the counter-intuitive
PUT-not-PATCHmetadata-update contract is exposed to users. Metadata updates go overPUTwith merge semantics (partial payloads are honored), which reads likePATCHbehavior on thePUTverb. 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.ServiceClientnever 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:Internally: GET the existing typed attribute -> apply overrides ->
PUTback with the correct derived@odata.type. Never exposePUT/PATCH/@odata.typeto the caller.Touchpoints
data/_odata.py-- new_update_attribute(retrieve-then-PUTwith@odata.type); reuse_odata_base.py::_attribute_payloadoverride-building from tables.create / add_columns cannot set column constraints (MaxLength, MinValue/MaxValue, Format, RequiredLevel, DisplayName) #194.operations/tables.py+aio/operations/async_tables.py-- newupdate_column/update_columns.@odata.typeon the outbound request.Acceptance
update_column(..., {"max_length": 4000})issues aPUTtoEntityDefinitions({id})/Attributes({id})withMaxLength: 4000and the correct derived@odata.type.@odata.type.Related