ihorton1 edited a comment on issue #13805:
URL: https://github.com/apache/airflow/issues/13805#issuecomment-844291902


   @dimberman unless I'm mistaken, it appears that although @MaxTaggart fixed 
the backfill issue related to this issue, the run command is still throwing the 
original error in 2.0.2.
   
   Would adding `job_id = 'manual'` in airflow/cli/commands/task_command.py fix 
the issue you think?
   
   ```
   def _run_task_by_executor(args, dag, ti):
       """
       Sends the task to the executor for execution. This can result in the 
task being started by another host
       if the executor implementation does
       """
       pickle_id = None
       if args.ship_dag:
           try:
               # Running remotely, so pickling the DAG
               with create_session() as session:
                   pickle = DagPickle(dag)
                   session.add(pickle)
                   pickle_id = pickle.id
                   # TODO: This should be written to a log
                   print(f'Pickled dag {dag} as pickle_id: {pickle_id}')
           except Exception as e:
               print('Could not pickle the DAG')
               print(e)
               raise e
       executor = ExecutorLoader.get_default_executor()
       executor.job_id = 'manual'
       executor.start()
       print("Sending to executor.")
       executor.queue_task_instance(
           ti,
           mark_success=args.mark_success,
           pickle_id=pickle_id,
           ignore_all_deps=args.ignore_all_dependencies,
           ignore_depends_on_past=args.ignore_depends_on_past,
           ignore_task_deps=args.ignore_dependencies,
           ignore_ti_state=args.force,
           pool=args.pool,
       )
       executor.heartbeat()
       executor.end()
   ```
   
   If so, wondering how i should test it. Happy to take this on. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to