Conversation
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\n\nThe
historical_ordersmodel was outputting monetary amounts in cents whilereal_time_ordersoutputs them in dollars. Since theordersmodel unions both viaUNION ALL, this created a ~100× mismatch in theamountcolumn for historical records.\n\nThis propagated through the pipeline:\nhistorical_orders→orders→customer_conversions→attribution_touches→cpa_and_roas\n\n...causing theRETURN_ON_ADVERTISING_SPENDanomaly test to fail with inflated ROAS values (incident has been failing for 69 consecutive runs).\n\n## Fix\n\n-historical_orders.sql: Apply thecents_to_dollarsmacro to all monetary columns, matching the pattern already used inreal_time_orders.sql\n-real_time_orders.sql: Add a clarifying comment that amounts are in dollars (no logic changes)\n\n## Impact\n\nThis fix will normalize all monetary values to dollars across both order sources, resolving the ROAS anomaly oncpa_and_roas.Created by:
maayan+172@elementary-data.com