Created
February 1, 2024 15:52
-
-
Save JeffreyMFarley/c6428ff4b241247c9a6e4f7810a57f95 to your computer and use it in GitHub Desktop.
This file contains 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
import random | |
from snowflake.snowpark.functions import trunc | |
def model(dbt, session): | |
source_df = dbt.ref("datorama_v2_temp") | |
campaigns = source_df[['campaign_id', 'day', 'impressions']] | |
campaigns = campaigns.withColumn( | |
'projected_five_sec_views', | |
trunc(campaigns['impressions'] * random.uniform(0.2, 0.5)) | |
) | |
campaigns = campaigns.drop('impressions') | |
return campaigns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment