Thank you. I've corrected the KeyError, and changed the function to: def overide_options(self, options, run_id=None): """ completely overide the options dict """ assert isinstance(options, dict), "override options requires a dict" if run_id in self.run_queue: self.run_queue[run_id] = options else: self.options = options