feat: regenerate SDK — build-fact-grid returns facts, not a pivot - #159
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regenerated against
mainafter 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
ViewResponseis typed{metadata, dimensions, facts, summary}instead of an untypedpresentationsdict.Added:
Dimension,DimensionType,FactRecord,ElementSummary,ViewResponseSummaryType0Removed:
ViewResponsePresentations,ViewAxisConfigMemberLabelsType0,ViewAxisConfigElementLabelsType0CreateViewRequestgainslimit(default 250, max 5000);ViewMetadatagainstruncated.ViewAxisConfigkeeps only the scoping fields —type,selected_members,include_null_dimension— andViewConfigdropsvalues,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 tobuildFactGrid,ViewResponse,ViewAxisConfig,CreateViewRequest, orpresentations.Note that
entity/entitiesis 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.