Repository navigation
Paginate the cohort builder and add a cohort CSV export - #21
Open
HarisChandio wants to merge 1 commit into
Open
HarisChandio wants to merge 1 commit into
HarisChandio wants to merge 1 commit into
Conversation
The cohort table on the Signals tab showed only the first 50 matches (the API returned at most 200) with no way to reach the rest. - POST /api/cohort takes offset/limit (default 50, max 200), orders by name so pages never overlap, and always reports the full size. - GET /api/cohort.csv exports every company in the cohort. - The UI gets Prev / Next, "Showing X–Y of N", and an Export CSV link. - Company lookups are chunked to stay under SQLite's bound-variable cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
@ethanplusai Hi, |
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.
Problem
The cohort builder on the Signals tab stops at the first 50 matches. The API returns at most 200 companies, the page slices that to 50 and says "Showing the first 50", and there is no way to see the rest. With 147 matches, 97 companies could not be seen anywhere in the dashboard.
Change
POST /api/cohorttakesoffsetandlimit(default 50, capped at 200). Results are ordered by name, then id, so pages never overlap or skip.sizeis always the whole cohort. The response keeps the existingsize/companieskeys, so existing callers still work.GET /api/cohort.csv?require=A,B&exclude=Cdownloads every company in the cohort (name, domain, website, industry, location).Testing
tests/test_dashboard_signals.py: paging through 120 matches returns all 120 in a stable order with no overlap, the page size is capped, the CSV contains every match rather than one page, and an empty cohort exports only the header.