You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/18 04:11:58 UTC

[GitHub] [airflow] MatrixManAtYrService commented on issue #15698: task_instance_mutation_hook not called by scheduler when importing airflow.models.taskinstance

MatrixManAtYrService commented on issue #15698:
URL: https://github.com/apache/airflow/issues/15698#issuecomment-842810436


   If I do:
   
   ```python3
   def task_instance_mutation_hook(ti):
       print("MUTATION HOOK CALLED")
   ```
   
   and run `airflow dags test mydagname $(date "+%Y-%m-%d")`, the message appears in stdout:
   ```
   [2021-05-18 04:03:43,472] {dagbag.py:487} INFO - Filling up the DagBag from /usr/local/airflow/dags
   MUTATION_HOOK_CALLED
   INFO - Adding to queue:  ['<TaskInstance: mydagname.mytaskname ...
   ```
   
   If I add the import and the type hint as shown above, the message stops showing up.  I still need to check whether the image I'm testing with includes the fix--but I think I'm replicating it at least.


-- 
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:
users@infra.apache.org