eval_recoreds now reads older records

This commit is contained in:
2024-10-20 19:30:01 +02:00
parent 1598bf56c3
commit 40ad69eccd
+16 -8
View File
@@ -7,7 +7,7 @@ BASE = "results"
VIN = 'WVWZZZE1ZMP010760' VIN = 'WVWZZZE1ZMP010760'
YEAR = 2024 YEAR = 2024
MONTH = 10 MONTH = 10
DAY = ['20'] DAY = ['19']
class Endpoint: class Endpoint:
@@ -120,16 +120,24 @@ for day in day_list:
for record in records: for record in records:
try: try:
vehicle_diff = record['data'] vehicle_diff = record['data']
if not record['info']['is_delta']: is_header = True
if 'is_delta' in record['info']:
if record['info']['is_delta']:
is_header = False
print(f"Found delta record #{record['info']['record_id']}")
if is_header:
print(f"Found full record #{record['info']['record_id']}")
last = {} last = {}
print(f"Found full record {record['info']['record_id']}")
except KeyError as e:
print(f"KeyError: {e}")
if is_header:
vehicle_data = vehicle_diff
else: else:
print(f"Found delta record {record['info']['record_id']}")
except KeyError:
pass
vehicle_data = jay_merge_full(last, vehicle_diff) vehicle_data = jay_merge_full(last, vehicle_diff)
last = vehicle_data last = vehicle_data
try: try:
for end_point in end_points: for end_point in end_points: