Skip to content

Mika via Elementary: Fix historical_orders model to convert monetary values from cents to dollars #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joostboon
Copy link
Collaborator

Description

This PR fixes an inconsistency in how monetary values are handled between historical_orders and real_time_orders models.

Issue

  • The real_time_orders model correctly converts monetary values from cents to dollars using the cents_to_dollars macro
  • The historical_orders model was not applying this conversion, leaving values in cents
  • This inconsistency caused anomalous values in downstream metrics, particularly affecting the return_on_advertising_spend calculations

Changes

  • Added cents_to_dollars conversion to all monetary fields in historical_orders model
  • Added a clarifying comment to the real_time_orders model to document that values are in dollars

This should resolve the anomalies detected in the cpa_and_roas model's ROAS metrics.

Created by: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant