@@ -299,9 +299,13 @@ def get_recent_test_coverage(probe_cc):
299
299
q = current_app .db_session .execute (s , {"probe_cc" : probe_cc })
300
300
coverage_map = {k : {} for k in TEST_GROUPS .keys ()}
301
301
for count , measurement_start_day , test_group in q :
302
- coverage_map [test_group ][measurement_start_day .strftime ("%Y-%m-%d" )] = int (
303
- count
304
- )
302
+ ts = measurement_start_day .strftime ("%Y-%m-%d" )
303
+ count = int (count )
304
+ try :
305
+ coverage_map [test_group ][ts ] = count
306
+ except KeyError as e :
307
+ # test_group='unknown' for missing test name in TEST_GROUPS
308
+ log .error (e , exc_info = 1 )
305
309
306
310
test_coverage = []
307
311
for test_group , coverage in coverage_map .items ():
@@ -492,11 +496,15 @@ def api_private_website_test_urls():
492
496
# Create next_url
493
497
if len (results ) >= limit :
494
498
args = dict (
495
- limit = limit , offset = offset + limit , probe_asn = probe_asn , probe_cc = probe_cc ,
499
+ limit = limit ,
500
+ offset = offset + limit ,
501
+ probe_asn = probe_asn ,
502
+ probe_cc = probe_cc ,
496
503
)
497
504
# TODO: remove BASE_URL?
498
505
next_url = urljoin (
499
- current_app .config ["BASE_URL" ], "/api/_/website_urls?%s" % urlencode (args ),
506
+ current_app .config ["BASE_URL" ],
507
+ "/api/_/website_urls?%s" % urlencode (args ),
500
508
)
501
509
metadata ["next_url" ] = next_url
502
510
@@ -609,8 +617,7 @@ def api_private_im_networks():
609
617
610
618
611
619
def isomid (d ) -> str :
612
- """Returns 2020-08-01T00:00:00+00:00
613
- """
620
+ """Returns 2020-08-01T00:00:00+00:00"""
614
621
return f"{ d } T00:00:00+00:00"
615
622
616
623
0 commit comments