Skip to content

Row cap on status endpoint - #168

Merged
DanielElisenberg merged 7 commits into
mainfrom
row_cap_on_status_endpoint
Sep 7, 2026
Merged

DanielElisenberg merged 7 commits into
mainfrom
row_cap_on_status_endpoint

Conversation

@DanielElisenberg

@DanielElisenberg DanielElisenberg commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator
  • Adds a DATA_ROW_CAP environment variable that defaults to 100_000_000, so we can deploy this without changing any config
  • Adds a row_cap optional argument to the domain data readers that throws a TooManyRowsException if supplied row_cap is exceeded
  • TooManyRowsExceptions are resolved to a 400 http response
  • Only the api endpoints for /status/stream uses row_cap for now

@DanielElisenberg
DanielElisenberg requested a review from a team as a code owner September 4, 2026 11:39
@DanielElisenberg DanielElisenberg added the wip Work in progress label Sep 4, 2026
@DanielElisenberg DanielElisenberg linked an issue Sep 4, 2026 that may be closed by this pull request
@linnbjornerud

Copy link
Copy Markdown
Contributor

I think it looks good!
Agree on using an env variable for the cap.
And remember to add the new exception to the exception handler.

@DanielElisenberg DanielElisenberg removed the wip Work in progress label Sep 4, 2026
Comment thread datastore_api/domain/data/__init__.py Outdated
Comment thread datastore_api/domain/data/__init__.py Outdated
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@pawbu pawbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Comment thread tests/unit/api/data/test_data_routes.py
@DanielElisenberg
DanielElisenberg merged commit 754d351 into main Sep 7, 2026
5 checks passed
@DanielElisenberg
DanielElisenberg deleted the row_cap_on_status_endpoint branch September 7, 2026 05:51
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.

Set import limit to 100 mill

3 participants