docs: def edit_task(self, task_name, **kwargs):
          """ Change the name of a Task owned by this Job.
  
          This will affect the historical data available for this
          Task, e.g. past run logs will no longer be accessible.
          """
  
          logger.debug('Job {0} editing task {1}'.format(self.name, task_name))
          if not self.state.allow_edit_task:
              raise DagobahError("tasks cannot be edited in this job's " +
                                 "current state")
  
          if task_name not in self.tasks:
              raise DagobahError('task %s not found' % task_name)
  
          if 'name' in kwargs and isinstance(kwargs['name'], str):
              if kwargs['name'] in self.tasks:
                  raise DagobahError('task name %s is unavailable' %
                                     kwargs['name'])
  
          task = self.tasks[task_name]
          for key in ['name', 'command']:
              if key in kwargs and isinstance(kwargs[key], str):
                  setattr(task, key, kwargs[key])
  
          if 'soft_timeout' in kwargs:
              task.set_soft_timeout(kwargs['soft_timeout'])
  
          if 'hard_timeout' in kwargs:
              task.set_hard_timeout(kwargs['hard_timeout'])
  
          if 'hostname' in kwargs:
              task.set_hostname(kwargs['hostname'])
  
          if 'name' in kwargs and isinstance(kwargs['name'], str):
              self.rename_edges(task_name, kwargs['name'])
              self.tasks[kwargs['name']] = task
              del self.tasks[task_name]
  
          self.parent.commit(cascade=True)