def format_action(action):
 if ('id' in action):
  del action['id']
 if ('finish_time' in action):
  del action['finish_time']
 return action

def format_action ( action ) : if ( 'id' in action ) : del action [ 'id' ] if ( 'finish_time' in action ) : del action [ 'finish_time' ] return action
remove keys that arent serialized .