Skip to content

Commit

Permalink
OnroadEvent migration: ignore deprecated events (#33731)
Browse files Browse the repository at this point in the history
ignore deprecate
  • Loading branch information
sshane authored Oct 4, 2024
1 parent ad5933c commit 91e4978
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions selfdrive/test/process_replay/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ def migrate_onroadEvents(msgs):
new_msg.logMonoTime = msg.logMonoTime

# dict converts name enum into string representation
new_msg.onroadEvents = [log.OnroadEvent(**event.to_dict()) for event in msg.onroadEventsDEPRECATED]
new_msg.onroadEvents = [log.OnroadEvent(**event.to_dict()) for event in msg.onroadEventsDEPRECATED if
not str(event.name).endswith('DEPRECATED')]
ops.append((index, new_msg.as_reader()))

return ops, [], []
Expand All @@ -419,7 +420,8 @@ def migrate_driverMonitoringState(msgs):
msg = msg.as_builder()
# dict converts name enum into string representation
msg.driverMonitoringState.events = [log.OnroadEvent(**event.to_dict()) for event in
msg.driverMonitoringState.eventsDEPRECATED]
msg.driverMonitoringState.eventsDEPRECATED if
not str(event.name).endswith('DEPRECATED')]
ops.append((index, msg.as_reader()))

return ops, [], []

0 comments on commit 91e4978

Please sign in to comment.