amoghrajesh commented on code in PR #53393:
URL: https://github.com/apache/airflow/pull/53393#discussion_r2282213969


##########
airflow-core/src/airflow/task/weight_rule.py:
##########
@@ -21,21 +21,9 @@
 
 import methodtools
 
-# Databases do not support arbitrary precision integers, so we need to limit 
the range of priority weights.
-# postgres: -2147483648 to +2147483647 (see 
https://www.postgresql.org/docs/current/datatype-numeric.html)
-# mysql: -2147483648 to +2147483647 (see 
https://dev.mysql.com/doc/refman/8.4/en/integer-types.html)
-# sqlite: -9223372036854775808 to +9223372036854775807 (see 
https://sqlite.org/datatype3.html)
-DB_SAFE_MINIMUM = -2147483648
-DB_SAFE_MAXIMUM = 2147483647
-
-
-def db_safe_priority(priority_weight: int) -> int:
-    """Convert priority weight to a safe value for the database."""
-    return max(DB_SAFE_MINIMUM, min(DB_SAFE_MAXIMUM, priority_weight))
-
 
 class WeightRule(str, Enum):

Review Comment:
   Yeah this move sounds like a better idea.



##########
task-sdk/tests/task_sdk/docs/test_docs_inventory.py:
##########
@@ -76,7 +76,7 @@ def test_docs_inventory_matches_public_api(tmp_path):
     public = set(getattr(sdk, "__all__", [])) - {"__version__"}
 
     extras = {"AirflowParsingContext"}
-    missing = public - documented
+    missing = (public - documented) - {"WeightRule"}

Review Comment:
   We will have many such in near future I assume, so could you instead declare 
a `excluded` set with those?



##########
airflow-core/src/airflow/task/weight_rule.py:
##########
@@ -21,21 +21,9 @@
 
 import methodtools
 
-# Databases do not support arbitrary precision integers, so we need to limit 
the range of priority weights.
-# postgres: -2147483648 to +2147483647 (see 
https://www.postgresql.org/docs/current/datatype-numeric.html)
-# mysql: -2147483648 to +2147483647 (see 
https://dev.mysql.com/doc/refman/8.4/en/integer-types.html)
-# sqlite: -9223372036854775808 to +9223372036854775807 (see 
https://sqlite.org/datatype3.html)
-DB_SAFE_MINIMUM = -2147483648
-DB_SAFE_MAXIMUM = 2147483647
-
-
-def db_safe_priority(priority_weight: int) -> int:
-    """Convert priority weight to a safe value for the database."""
-    return max(DB_SAFE_MINIMUM, min(DB_SAFE_MAXIMUM, priority_weight))
-
 
 class WeightRule(str, Enum):

Review Comment:
   Could we also update: `airflow-core/src/airflow/task/priority_strategy.py` 
to use the values from this enum?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to