Repository navigation
refactor(core): split analytics reads into a reads package - #996
Open
zaira-bibi wants to merge 1 commit into
Open
zaira-bibi wants to merge 1 commit into
zaira-bibi wants to merge 1 commit into
Conversation
zaira-bibi
added this pull request to stack #997
October 26, 2026 07:05
Reads code was spread over reads.py, a mixed schemas/reads.py and a top-level enums.py, and its bucket SQL was private though Explore needs it. The reads package splits it into buckets, rollups, queries, schemas and enums with the bucket helpers public, and the catalog's models move next to the catalog. The sparkth.lib.analytics surface is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
zaira-bibi
force-pushed
the
zaira/be/analytics-reads-module
branch
from
October 26, 2026 07:07
822229c to
00f435c
Compare
This branch has not been deployed
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.
What
Analytics read code was spread over
reads.py, aschemas/reads.pythat mixed models and enums, and atop-level
enums.py, and its bucket SQL was private even though Explore needs it. This moves it into areadspackage of small, single-purpose files, with no behaviour change.Changes
sparkth/core/analytics/reads/replacesreads.py,schemas/reads.pyandenums.py:buckets.py: the PostgreSQL and SQLite bucket SQL and the day-range conditions, now public(
PG_BUCKET,SQLITE_BUCKET,in_days)rollups.py:read_rollupand its SQL-identifier checksqueries.py:get_logins, the core Overview figures andsummarizeschemas.py:RangeQuery,LoginsPoint,SummaryCountenums.py:Bucketcatalog/schemas.pyandFieldKindincatalog/enums.pyschemas/now holds only the event schemassparkth.lib.analyticsexports the same names, so plugins and routes are unchangedHow to Test
uv run pytest -q: the whole suite passes unchanged.make test.frontend.api: the OpenAPI schema and generated client are unchanged.Environment Variables
Notes
This description was written with the assistance of an LLM (Claude).
🤖 Generated with Claude Code