eval_recoreds now reads older records
This commit is contained in:
+16
-8
@@ -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']}")
|
|
||||||
else:
|
|
||||||
print(f"Found delta record {record['info']['record_id']}")
|
|
||||||
|
|
||||||
except KeyError:
|
except KeyError as e:
|
||||||
pass
|
print(f"KeyError: {e}")
|
||||||
|
|
||||||
|
if is_header:
|
||||||
|
vehicle_data = vehicle_diff
|
||||||
|
else:
|
||||||
|
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:
|
||||||
|
|||||||
Reference in New Issue
Block a user