Skip to content

Commit

Permalink
user metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-dhanwant-yral committed Aug 26, 2024
1 parent 4a9833f commit 4c8b8ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion global_video_stats/ds__global_video_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def run_query():
'retries': 1,
}

with DAG('global_video_stats', default_args=default_args, schedule_interval='*/15 * * * *', catchup=False) as dag:
with DAG('global_video_stats', default_args=default_args, schedule_interval='*/45 * * * *', catchup=False) as dag:
run_query_task = PythonOperator(
task_id='run_query_task',
python_callable=run_query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run_query():
'retries': 1,
}

with DAG('video_statistics_normalized', default_args=default_args, schedule_interval='*/15 * * * *', catchup=False) as dag:
with DAG('video_statistics_normalized', default_args=default_args, schedule_interval='*/50 * * * *', catchup=False) as dag:
run_query_task = PythonOperator(
task_id='run_query_task',
python_callable=run_query,
Expand Down
5 changes: 3 additions & 2 deletions video_statistics/ds__video_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def create_initial_query():
uvr.user_id,
(1 - IFNULL(user_like_avg, 1)) * CAST(liked AS INT64) AS user_normalized_like_contribution,
(1 - IFNULL(user_share_avg, 1)) * CAST(shared AS INT64) AS user_normalized_share_contribution,
((100 - IFNULL(user_watch_percentage_avg, 100))/100) * mean_percentage_watched AS user_normalized_watch_contribution
((100 - IFNULL(user_watch_percentage_avg, 100))/100) * mean_percentage_watched AS user_normalized_watch_contribution,
last_watched_timestamp
FROM
`hot-or-not-feed-intelligence.yral_ds.userVideoRelation` uvr
LEFT JOIN
Expand Down Expand Up @@ -125,7 +126,7 @@ def run_query():
'retries': 1,
}

with DAG('video_statistics', default_args=default_args, schedule_interval='*/15 * * * *', catchup=False) as dag:
with DAG('video_statistics', default_args=default_args, schedule_interval='*/35 * * * *', catchup=False) as dag:
run_query_task = PythonOperator(
task_id='run_query_task',
python_callable=run_query,
Expand Down

0 comments on commit 4c8b8ea

Please sign in to comment.