JCoder01 commented on issue #8061:
URL: https://github.com/apache/airflow/issues/8061#issuecomment-808822780


   Hi @rabsr here you go, let me know if you have any questions.
   ```
   from airflow.settings import DAGS_FOLDER
   from airflow.models.taskinstance import TaskInstance
   from typing import Optional, List
   from datetime import datetime
   
   old_generate_command = TaskInstance.generate_command
   def new_generate_command(
           dag_id: str,  # pylint: disable=too-many-arguments
           task_id: str,
           execution_date: datetime,
           mark_success: bool = False,
           ignore_all_deps: bool = False,
           ignore_depends_on_past: bool = False,
           ignore_task_deps: bool = False,
           ignore_ti_state: bool = False,
           local: bool = False,
           pickle_id: Optional[int] = None,
           file_path: Optional[str] = None,
           raw: bool = False,
           job_id: Optional[str] = None,
           pool: Optional[str] = None,
           cfg_path: Optional[str] = None,
   ) -> List[str]:
       dags_folder = f'{DAGS_FOLDER}/' if not DAGS_FOLDER.endswith('/') else 
DAGS_FOLDER
       file_path = file_path.replace(dags_folder, 'DAGS_FOLDER/')
       return old_generate_command(dag_id,
                                  task_id,
                                  execution_date,
                                  mark_success,
                                  ignore_all_deps,
                                  ignore_depends_on_past,
                                  ignore_task_deps,
                                  ignore_ti_state,
                                  local,
                                  pickle_id,
                                  file_path,
                                  raw,
                                  job_id,
                                  pool,
                                  cfg_path)
   
   TaskInstance.generate_command = new_generate_command
   ```


-- 
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