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 2022/01/26 07:42:56 UTC

[GitHub] [airflow] uranusjr opened a new pull request #21116: Ensure clear_task_instances sets valid run state

uranusjr opened a new pull request #21116:
URL: https://github.com/apache/airflow/pull/21116


   Also took the chance to change some State usages to TaskInstanceState for better type safety.
   
   This plus #21062 should close #21058.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #21116: Ensure clear_task_instances sets valid run state

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #21116:
URL: https://github.com/apache/airflow/pull/21116#discussion_r792460379



##########
File path: airflow/models/taskinstance.py
##########
@@ -220,7 +220,7 @@ def clear_task_instances(
                 # outdated. We make max_tries the maximum value of its
                 # original max_tries or the last attempted try number.
                 ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
-            ti.state = State.NONE
+            ti.state = TaskInstanceState.NONE

Review comment:
       Ah yeah I remember being told about this… Maybe we should remove `TaskInstanceState.NONE` altogether at some point and just use `None` (the built-in one).




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #21116: Ensure clear_task_instances sets valid run state

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #21116:
URL: https://github.com/apache/airflow/pull/21116#issuecomment-1022012776


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr merged pull request #21116: Ensure clear_task_instances sets valid run state

Posted by GitBox <gi...@apache.org>.
uranusjr merged pull request #21116:
URL: https://github.com/apache/airflow/pull/21116


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #21116: Ensure clear_task_instances sets valid run state

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #21116:
URL: https://github.com/apache/airflow/pull/21116#discussion_r792458108



##########
File path: airflow/models/taskinstance.py
##########
@@ -220,7 +220,7 @@ def clear_task_instances(
                 # outdated. We make max_tries the maximum value of its
                 # original max_tries or the last attempted try number.
                 ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
-            ti.state = State.NONE
+            ti.state = TaskInstanceState.NONE

Review comment:
       I have had an issue with `TaskInstanceState.NONE`, it gives the string 'None' instead of a null value. We should use State.NONE instead




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org