6262 },
6363}
6464
65-
65+ @sl .cache_data (
66+ ttl = 60 ,
67+ hash_funcs = {
68+ bigquery .Client : lambda _ : None , # or id(_)
69+ types .FunctionType : lambda _ : None , # ignore function hashing
70+ types .MethodType : lambda _ : None , # ignore method hashing
71+ }
72+ )
6673def get_user_sensor_data (client : bigquery .Client , user_id : str , workout_id : str ):
6774 """Returns a list of timestampped information for a given workout.
6875 """
@@ -130,7 +137,7 @@ def get_user_sensor_data(client: bigquery.Client, user_id: str, workout_id: str)
130137
131138
132139@sl .cache_data (
133- ttl = 60 , # Set a 300-second TTL
140+ ttl = 60 ,
134141 hash_funcs = {
135142 bigquery .Client : lambda _ : None , # or id(_)
136143 types .FunctionType : lambda _ : None , # ignore function hashing
@@ -166,6 +173,7 @@ def default_execute_query(client, query):
166173
167174#used gemini for assistance:
168175@sl .cache_data (
176+ ttl = 200 ,
169177 hash_funcs = {
170178 bigquery .Client : lambda _ : None , # or id(_)
171179 types .FunctionType : lambda _ : None , # ignore function hashing
@@ -219,11 +227,11 @@ def default_execute_query(client, query):
219227
220228#used gemini for assistance:
221229@sl .cache_data (
222- ttl = 30 , # Set a 300-second TTL
230+ ttl = 30 ,
223231 hash_funcs = {
224- bigquery .Client : lambda _ : None , # or id(_)
225- types .FunctionType : lambda _ : None , # ignore function hashing
226- types .MethodType : lambda _ : None , # ignore method hashing
232+ bigquery .Client : lambda _ : None ,
233+ types .FunctionType : lambda _ : None ,
234+ types .MethodType : lambda _ : None ,
227235 }
228236)
229237def get_user_posts (user_id , query_db = bigquery , execute_query = None ):
@@ -302,9 +310,9 @@ def default_execute_query(client, query):
302310@sl .cache_data (
303311 ttl = 300 , # Set a 300-second TTL
304312 hash_funcs = {
305- bigquery .Client : lambda _ : None , # or id(_)
306- types .FunctionType : lambda _ : None , # ignore function hashing
307- types .MethodType : lambda _ : None , # ignore method hashing
313+ bigquery .Client : lambda _ : None ,
314+ types .FunctionType : lambda _ : None ,
315+ types .MethodType : lambda _ : None ,
308316 }
309317)
310318def get_user_friends (user_id , query_db = bigquery , execute_query = None ):
@@ -331,9 +339,9 @@ def default_execute_query(client, query):
331339
332340@sl .cache_data (
333341 hash_funcs = {
334- bigquery .Client : lambda _ : None , # or id(_)
335- types .FunctionType : lambda _ : None , # ignore function hashing
336- types .MethodType : lambda _ : None , # ignore method hashing
342+ bigquery .Client : lambda _ : None ,
343+ types .FunctionType : lambda _ : None ,
344+ types .MethodType : lambda _ : None ,
337345 }
338346)
339347def get_user_info (user_id , query_db = bigquery , execute_query = None ):
@@ -367,11 +375,13 @@ def default_execute_query(client, query):
367375 else :
368376 return None
369377
370- @sl .cache_data (
378+
379+
380+ @sl .cache_data (
381+ ttl = 120 ,
371382 hash_funcs = {
372- bigquery .Client : lambda _ : None , # or id(_)
373- types .FunctionType : lambda _ : None , # ignore function hashing
374- types .MethodType : lambda _ : None , # ignore method hashing
383+ bigquery .Client : lambda _ : None ,
384+ types .FunctionType : lambda _ : None ,
375385 }
376386)
377387def get_genai_advice (
0 commit comments