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/02/25 15:38:47 UTC

[GitHub] [airflow] michaelmicheal opened a new issue #21821: Rename `priority_weight` attribute(s)

michaelmicheal opened a new issue #21821:
URL: https://github.com/apache/airflow/issues/21821


   ### Description
   
   Currently, the priority weight attributes in the BaseOperator and TaskInstance classes have misleading names. 
   
   As I understand it, BaseOperator has two priority weight attributes: `priority_weight` and `priority_weight_total`, where `priority_weight` is the user defined single-task priority weight, and `priority_weight_total` represents the total priority of the task and all downstream tasks based on a weight rule.
   
   
   TaskInstance has a single priority weight attribute: `priority_weight`. However, when TaskInstance attributes are defined, `priority_weight` is defined as the task's  `priority_weight_total`.
   ```python
           self.priority_weight = task.priority_weight_total
   ```
   This is potentially confusing since BaseOperator and TaskInstance both have the attribute `priority_weight`, but represent different measures of priority.
   
   
   
   ### Use case/motivation
   
   I'm wondering if we can rename the `priority_weight` attribute in the BaseOperator class and/or the TaskInstance class to prevent confusion.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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] boring-cyborg[bot] commented on issue #21821: Rename `priority_weight` attribute(s)

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #21821:
URL: https://github.com/apache/airflow/issues/21821#issuecomment-1050961042


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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] potiuk commented on issue #21821: Rename `priority_weight` attribute(s)

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #21821:
URL: https://github.com/apache/airflow/issues/21821#issuecomment-1053728218


   The `priority_weight_total` includes downstream or upstream tasks prioroties) -depending on the weight rule. This is very clear to me. TaskInstance when executing is considered to have priority based on total weight (including upstram or downstram or both priorities). 
   
   This is natural consequences that Task is a definition (static) and TaskInstance is "runtime" (i.e. it contains acual status used for scheduling). I see completely no problem with it. Not sure what the proposal is here. 
   
   @michaelmicheal  - if you have a concrete proposal please open a PR and explain what you want to improve here.
   
   I am also converting this into discussion.


-- 
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] SamWheating commented on issue #21821: Rename `priority_weight` attribute(s)

Posted by GitBox <gi...@apache.org>.
SamWheating commented on issue #21821:
URL: https://github.com/apache/airflow/issues/21821#issuecomment-1051093680


   This can get especially misleading in the `Task Instance details` page where there `priority_weight` is listed twice (potentially with different values if there are downstream tasks)


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