Skip to content

Populate derived expression and frozen measures during deployment#2050

Merged
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:deployment-frozen-measures
Apr 24, 2026
Merged

Populate derived expression and frozen measures during deployment#2050
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:deployment-frozen-measures

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Apr 23, 2026

Summary

Metrics created or updated through /deployments now have their derived_expression and FrozenMeasure rows populated atomically with the rest of the deployment, closing a gap where only the single-node create/update paths scheduled this metadata derivation as a background task.

Bulk-deployed metrics previously landed with derived_expression = NULL, which forced every GraphQL read (see this recent change #2049) to re-run metric component extraction.

The orchestrator now includes a "derive measures" phase inside the deployment savepoint (committed on wet-run, rolled back on dry-run), so derivation shares the atomicity guarantees of the rest of the deployment. The new derive_frozen_measures_bulk batches DB work via MetricComponentExtractor's existing cache params, collapsing what would have been N × (2 + avg measures) queries per deployment into ~2 queries (one to load all target revisions + parent chain, one to pre-fetch existing frozen measure rows by name).

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 23, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 0a58501
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69eb455093b41d00098c7839

@shangyian shangyian force-pushed the deployment-frozen-measures branch from 723c5fe to c8dbfc6 Compare April 24, 2026 09:32
@shangyian shangyian changed the title Deployment frozen measures Populate derived expression and frozen measures during deployment Apr 24, 2026
@shangyian shangyian marked this pull request as ready for review April 24, 2026 09:45
@shangyian shangyian merged commit fe71302 into DataJunction:main Apr 24, 2026
24 of 25 checks passed
@shangyian shangyian deleted the deployment-frozen-measures branch April 24, 2026 10:27
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.

1 participant