You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/10/29 22:54:20 UTC

[PR] Fix weight_rule property type in mappedoperator [airflow]

hussein-awala opened a new pull request, #35257:
URL: https://github.com/apache/airflow/pull/35257

   (no comment)


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


Re: [PR] Fix weight_rule property type in mappedoperator [airflow]

Posted by "utkarsharma2 (via GitHub)" <gi...@apache.org>.
utkarsharma2 commented on code in PR #35257:
URL: https://github.com/apache/airflow/pull/35257#discussion_r1375942435


##########
airflow/models/mappedoperator.py:
##########
@@ -470,7 +470,7 @@ def priority_weight(self) -> int:  # type: ignore[override]
         return self.partial_kwargs.get("priority_weight", DEFAULT_PRIORITY_WEIGHT)
 
     @property
-    def weight_rule(self) -> int:  # type: ignore[override]
+    def weight_rule(self) -> str:  # type: ignore[override]

Review Comment:
   We may not need it. Now, that we changed the return type from `int` to `str`, `MappedOperator.weight_rule` no longer deviates from it's parent `AbstractOperator.weight_rule` of type string. 



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


Re: [PR] Fix weight_rule property type in mappedoperator [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal merged PR #35257:
URL: https://github.com/apache/airflow/pull/35257


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


Re: [PR] Fix weight_rule property type in mappedoperator [airflow]

Posted by "utkarsharma2 (via GitHub)" <gi...@apache.org>.
utkarsharma2 commented on code in PR #35257:
URL: https://github.com/apache/airflow/pull/35257#discussion_r1375942435


##########
airflow/models/mappedoperator.py:
##########
@@ -470,7 +470,7 @@ def priority_weight(self) -> int:  # type: ignore[override]
         return self.partial_kwargs.get("priority_weight", DEFAULT_PRIORITY_WEIGHT)
 
     @property
-    def weight_rule(self) -> int:  # type: ignore[override]
+    def weight_rule(self) -> str:  # type: ignore[override]

Review Comment:
   We maybe not need it. Now, that we changed the return type from `int` to `str`, `MappedOperator.weight_rule` no longer deviates from it's parent `AbstractOperator.weight_rule` of type string. 



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


Re: [PR] Fix weight_rule property type in mappedoperator [airflow]

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on code in PR #35257:
URL: https://github.com/apache/airflow/pull/35257#discussion_r1376817841


##########
airflow/models/mappedoperator.py:
##########
@@ -470,7 +470,7 @@ def priority_weight(self) -> int:  # type: ignore[override]
         return self.partial_kwargs.get("priority_weight", DEFAULT_PRIORITY_WEIGHT)
 
     @property
-    def weight_rule(self) -> int:  # type: ignore[override]
+    def weight_rule(self) -> str:  # type: ignore[override]

Review Comment:
   The `weight_rule ` is defined in the superclass (AbstractOperator) as a normal attribute, but here, we override it to a property, so Mypy doesn't like this override. We have the same ignore for all the overridden attributes.



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


Re: [PR] Fix weight_rule property type in mappedoperator [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #35257:
URL: https://github.com/apache/airflow/pull/35257#discussion_r1375728253


##########
airflow/models/mappedoperator.py:
##########
@@ -470,7 +470,7 @@ def priority_weight(self) -> int:  # type: ignore[override]
         return self.partial_kwargs.get("priority_weight", DEFAULT_PRIORITY_WEIGHT)
 
     @property
-    def weight_rule(self) -> int:  # type: ignore[override]
+    def weight_rule(self) -> str:  # type: ignore[override]

Review Comment:
   why do we need `type: ignore` here?



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