Skip to content

Commit

Permalink
debug if the user don't play game
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois-lenne committed Mar 23, 2024
1 parent 30f834b commit 741ec0e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ def main(request):

df_trophee['date'] = pd.Timestamp.now().date()

# Afficher le DataFrame
print(df_trophee)



# Convert the date columns to datetime for BigQuery
Expand All @@ -332,21 +329,23 @@ def main(request):

time_play_df = update_time_play(old_game_df, df_game)

if len(time_play_df) > 0:


load_df_to_bigquery(time_play_df, f"{project_id}.{dataset_name}.{os.getenv('TABLE_NAME_TIME_PLAY')}")
load_df_to_bigquery(time_play_df, f"{project_id}.{dataset_name}.{os.getenv('TABLE_NAME_TIME_PLAY')}")


df_game_filtered = game_need_update(time_play_df, df_game)
df_game_filtered = game_need_update(time_play_df, df_game)


target_table_id = f"{project_id}.{dataset_name}.{os.getenv('TABLE_NAME_GAME')}"
target_table_id = f"{project_id}.{dataset_name}.{os.getenv('TABLE_NAME_GAME')}"

temp_table_id = f"{project_id}.{dataset_name}.temp_table"
temp_table_id = f"{project_id}.{dataset_name}.temp_table"



# Utilisez la fonction pour mettre à jour une table BigQuery à partir d'un DataFrame
update_bigquery_table_from_df(df_game_filtered, temp_table_id, target_table_id)
# Utilisez la fonction pour mettre à jour une table BigQuery à partir d'un DataFrame
update_bigquery_table_from_df(df_game_filtered, temp_table_id, target_table_id)

return 'Success', 200

Expand Down

0 comments on commit 741ec0e

Please sign in to comment.