Skip to content

feat: regenerate SDK — build-fact-grid returns facts, not a pivot - #159

Merged
jfrench9 merged 1 commit into
mainfrom
feature/regenerate-fact-grid-facts-response
Jul 30, 2026
Merged

feat: regenerate SDK — build-fact-grid returns facts, not a pivot#159
jfrench9 merged 1 commit into
mainfrom
feature/regenerate-fact-grid-facts-response

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Regenerated against main after RoboFinSystems/robosystems#976 and #977.

What changed upstream

build-fact-grid's pivot arm never actually pivoted — the builder resolved its value column to a name the query doesn't emit, so every call fell through to a raw dump. Correcting the column alone would have been worse: the pivot summed across entities and across taxonomies whose elements share a local name. Collapsing facts into cells needs the full aspect signature (element · period · entity · unit), so the server now returns the facts and leaves arrangement to the consumer.

Generated surface

ViewResponse is typed {metadata, dimensions, facts, summary} instead of an untyped presentations dict.

Added: Dimension, DimensionType, FactRecord, ElementSummary, ViewResponseSummaryType0
Removed: ViewResponsePresentations, ViewAxisConfigMemberLabelsType0, ViewAxisConfigElementLabelsType0

CreateViewRequest gains limit (default 250, max 5000); ViewMetadata gains truncated. ViewAxisConfig keeps only the scoping fields — type, selected_members, include_null_dimension — and ViewConfig drops values, aggregation_function, fill_value. Those all configured a pivot that no longer exists.

Facts now always carry entity_ticker / entity_name; previously they were omitted unless an entity filter was passed, which made multi-filer results impossible to attribute.

Compatibility

Breaking for anyone reading response.presentations. In practice that field carried a flat DataFrame dump rather than a pivot table, and a sweep of all five consuming repos found zero references to buildFactGrid, ViewResponse, ViewAxisConfig, CreateViewRequest, or presentations.

Note that entity / entities is now required on shared-repository graphs (e.g. SEC) — a request that previously succeeded unscoped will return 400.

Verification

just test-all — 490 passed, 17 skipped; ruff format and check clean; basedpyright 0 errors.

No version bump; leaving that for the release cut.

Picks up robosystems#976 and #977.

`ViewResponse` is now typed `{metadata, dimensions, facts, summary}`
instead of an untyped `presentations` dict — the endpoint returns
deduplicated fact records rather than a server-side pivot, since
collapsing facts into cells safely requires the full aspect signature
(element, period, entity, unit) and belongs to whatever renders them.

New models: `Dimension`, `DimensionType`, `FactRecord`, `ElementSummary`,
`ViewResponseSummaryType0`. Removed: `ViewResponsePresentations`,
`ViewAxisConfigMemberLabelsType0`, `ViewAxisConfigElementLabelsType0`.

`CreateViewRequest` gains `limit` (default 250, max 5000) and
`ViewMetadata` gains `truncated`. `ViewAxisConfig` keeps only the
scoping fields — `type`, `selected_members`, `include_null_dimension`;
the ordering and labelling knobs configured a pivot that no longer
exists. `ViewConfig` drops `values`, `aggregation_function`, and
`fill_value` for the same reason.

Breaking for anyone reading `response.presentations`, though the field
carried a flat DataFrame dump rather than a pivot table in practice.
@jfrench9
jfrench9 merged commit f945c20 into main Jul 30, 2026
1 check passed
@jfrench9
jfrench9 deleted the feature/regenerate-fact-grid-facts-response branch July 30, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant