feat: P2 enhancements — filtering, column selection, untyped data, performance - #2
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ODataFeed has no 10,000-row page limit, reducing HTTP round-trips for large tables from 50+ requests to 1-5. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept a filters parameter as either a raw OData string or a dict mapping dimension keys to value lists. periods param still works and is combined with filters using AND. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept column names as human-readable titles or CBS keys. Maps titles back to keys for the $select OData parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When typed=False, fetch UntypedDataSet to preserve CBS statistical symbols (. = not applicable, x = suppressed, - = nil) instead of replacing them with null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add documentation for filters, columns, typed parameters. Add half-yearly period format. Remove references to deleted dutch_name and display_name fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Phase 2 enhancements to cbspy, adding power-user features to
get_data()and improving performance for large tables.New features
filtersparameter) — Filter any dimension using a dict of key→value lists (e.g.filters={"RegioS": ["GM0363", "GM0599"]}) or a raw OData$filterstring. Combines with the existingperiodsparameter via AND logic.columnsparameter) — Restrict returned columns using human-readable names (e.g."Total population") or CBS keys (e.g."TotalPopulation_1"). Maps titles back to OData$selectkeys automatically, reducing bandwidth for wide tables.typed=False) — Fetch fromUntypedDataSetinstead ofTypedDataSetto preserve CBS statistical symbols (.= not applicable,x= suppressed,-= nil) that are normally replaced with null.2023HJ01→"2023 H1"and2023HJ02→"2023 H2".Performance
/ODataApi/odatato/ODataFeed/OData, which has no 10,000-row page limit. This reduces HTTP round-trips for large tables from 50+ requests down to 1–5.Documentation
filters,columns, andtypedparametersdutch_name/display_namementions)Tests
periods+filterstyped=True(default) vstyped=Falsedataset routingTest plan
make check— linting (ruff) and type checking (ty) passmake test— all tests pass with full coverage of new features71450ned)🤖 Generated with Claude Code