Skip to content

feat: migrate performance endpoints to Insights Snowflake - #215

Merged
santhosh-apphelix-2u merged 3 commits into
masterfrom
lp-1002-insights-snowflake-performance
Sep 4, 2026
Merged

feat: migrate performance endpoints to Insights Snowflake#215
santhosh-apphelix-2u merged 3 commits into
masterfrom
lp-1002-insights-snowflake-performance

Conversation

@santhosh-apphelix-2u

Copy link
Copy Markdown

Description

This PR completes the last group of the Insights Snowflake API migration by moving the performance endpoints behind the global Snowflake Waffle flag.

Migrated endpoints:

  • GET /api/v1/courses/{course_id}/problems/
  • GET /api/v1/problems/{problem_id}/answer_distribution/

When insights_snowflake_enabled is enabled, these endpoints read from Snowflake. When the flag is disabled, they continue using the existing Aurora flow.

Changes

  • Added Snowflake query helpers for performance data using PROBLEM_ANSWER_DISTRIBUTION.
  • Added mappers to keep the API response shape same as the existing Aurora response.
  • Wired the performance views to use Snowflake only when the global flag is enabled.
  • Preserved existing answer distribution consolidation and serializer behavior.
  • Added tests for Snowflake query building, mapper output, service wiring, Aurora fallback, and Snowflake routing.

Notes

This is the final planned API migration PR for LP-1002. Out-of-scope legacy endpoints like problems_and_tags, grade_distribution, and sequential_open_distribution are unchanged.

Co-authored-by: santhosh-apphelix-2u <211942388+santhosh-apphelix-2u@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  analytics_data_api/insights_snowflake
  service.py
  analytics_data_api/insights_snowflake/mappers
  performance.py 21, 28, 35, 52, 55
  analytics_data_api/insights_snowflake/queries
  performance.py
  analytics_data_api/tests
  test_insights_snowflake.py
  analytics_data_api/v0/tests/views
  test_courses.py
  test_problems.py
  analytics_data_api/v0/views
  courses.py
  problems.py
Project Total  

This report was generated by python-coverage-comment-action

@santhosh-apphelix-2u
santhosh-apphelix-2u marked this pull request as ready for review September 4, 2026 05:23
@santhosh-apphelix-2u
santhosh-apphelix-2u merged commit 7cdf87d into master Sep 4, 2026
5 checks passed
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.

3 participants