You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88e729d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(python): close attr-schema coverage gap — typed value_type for cross-port attrs
Python's field schema previously only registered @column, @storage, and
@objectref with a typed value_type, so the YAML desugar's D2 type-coercion
guard (ADR-0006) never fired for the other common field attrs. TS / C# /
Java already enforce these via their typed schemas — Python was the
outlier, silently accepting `maxLength: TRUE` etc.
Adds typed AttrSchema for every common field attr Python was missing:
@required boolean
@unique boolean
@default None (polymorphic — value-type follows owning
field's subtype; guard skips when value_type is None)
@maxlength int
@precision int
@scale int
@filterable boolean
@Sortable boolean
@sortableDefaultOrder string (allowed: asc, desc)
@autoset string (allowed: onCreate, onUpdate)
Mirrors server/typescript/.../core/field/field-schema.ts `commonFieldAttrs`
and server/csharp/.../Core/Field/FieldSchema.cs `CommonFieldAttrs`. The new
constants live in field_constants.py alongside their TS/C# peers (cross-
port parity). _FIELD_COMMON_ATTRS is now shared between field.* and
field.enum (was a separate hand-typed copy).
Also: AttrSchema.value_type is now Optional[str] to permit declaring a
"known but untyped" attr (e.g. @default), matching TS's `valueType?: string`
shape. The coercion guard already short-circuits when value_type is None.
Re-adds fixture error-yaml-coerced-bool-in-int that the YAML corpus
expansion (b2dc546) had to drop because Python's gap meant only 3/4 ports
fired. Now all four ports (TS, C#, Java, Python) emit
ERR_YAML_COERCION + ERR_BAD_ATTR_VALUE for `maxLength: TRUE`.
Verification:
Python 506 passed (was 505 baseline + 1 new fixture)
TS yaml-conformance 13/13
C# YamlConformance 13/13
Java YamlConformanceTest 13/13
TS metadata full 1226/1226
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments