Problem
The Tango API supports bracket parameters on shape expansions — e.g. on entities, shape=uei,display_name,past_performance[top=10](summary,top_agencies) where [top=N] controls how many top agencies are aggregated (default 5, max 100). The server accepts and honors this syntax.
The SDK cannot request it. ShapeParser raises before the shape is even usable for response parsing:
tango.exceptions.ShapeParseError: Expected ',' or ')' but found '['
File "tango/shapes/parser.py", line 310, in _parse_field_list
Verified live: the HTTP request itself succeeds with the bracketed shape (the server returns correct past_performance aggregates), but _parse_response_with_shape → self._shape_parser.parse(shape) dies on the [, so list_entities(shape="...past_performance[top=10](...)") raises after a successful API call. The bracket-less form past_performance(summary,top_agencies) works end to end with the server's top-5 default, which is the current workaround.
Ask
Teach ShapeParser._parse_field_list to consume an optional [key=value] segment after a field name (before the parenthesized subfield list), carrying it through to the request while treating the field as its bare name (past_performance) for schema validation and response parsing — the response key has no bracket.
Notes
- The schema side needs no new fields:
past_performance is already shape-valid on entities (validated since 1.4.0's overlay regeneration).
- A conformance/coverage angle to consider: nothing in the vendored contract currently describes bracket parameters, so parser support probably lands with a unit-level parse/round-trip test rather than a contract-driven one.
🤖 Generated with Claude Code
Problem
The Tango API supports bracket parameters on shape expansions — e.g. on entities,
shape=uei,display_name,past_performance[top=10](summary,top_agencies)where[top=N]controls how many top agencies are aggregated (default 5, max 100). The server accepts and honors this syntax.The SDK cannot request it.
ShapeParserraises before the shape is even usable for response parsing:Verified live: the HTTP request itself succeeds with the bracketed shape (the server returns correct
past_performanceaggregates), but_parse_response_with_shape→self._shape_parser.parse(shape)dies on the[, solist_entities(shape="...past_performance[top=10](...)")raises after a successful API call. The bracket-less formpast_performance(summary,top_agencies)works end to end with the server's top-5 default, which is the current workaround.Ask
Teach
ShapeParser._parse_field_listto consume an optional[key=value]segment after a field name (before the parenthesized subfield list), carrying it through to the request while treating the field as its bare name (past_performance) for schema validation and response parsing — the response key has no bracket.Notes
past_performanceis already shape-valid on entities (validated since 1.4.0's overlay regeneration).🤖 Generated with Claude Code