Skip to content

Two fixes related to main graph and revenue metrics#6331

Open
RobertJoonas wants to merge 4 commits intomasterfrom
fix-graph-revenue-metric-500
Open

Two fixes related to main graph and revenue metrics#6331
RobertJoonas wants to merge 4 commits intomasterfrom
fix-graph-revenue-metric-500

Conversation

@RobertJoonas
Copy link
Copy Markdown
Contributor

Changes

  • Code refactor: organize QueryBuilder.do_build a bit better, using a pipeline with steps rather than a long function.
  • Fix 1: querying revenue metrics while including imported data resulted in invalid SQL due to the imported pagination optimization
  • Fix 2: optimistic graph fetch 500 -- stored graph metric is a revenue metric -> goal filter gets removed -> optimistic attempt to fetch the graph -> revenue metrics dropped -> empty metrics -> invalid SQL.

Tests

  • Automated tests have been added

Changelog

  • No update needed. Both bugs surfaced with main graph v2 which still hasn't made it to a CE release

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

This fixes a 500 error where we're trying to optimistically fetch the
main graph with a stored revenue metric, while the goal filter has been
removed.

Rather than dropping revenue metrics in QueryOptimizer (which does not
validate anything), we will do it in QueryBuilder instead. Query building
will fail when dropping revenue metrics leaves query.metrics empty.
@RobertJoonas RobertJoonas force-pushed the fix-graph-revenue-metric-500 branch from e9a5f22 to 2df67ea Compare May 8, 2026 14:36
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