sunank200 commented on code in PR #53393: URL: https://github.com/apache/airflow/pull/53393#discussion_r2262566872
########## airflow-core/src/airflow/utils/weight_rule.py: ########## @@ -21,19 +21,8 @@ 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)) - +# TODO: This can be moved to airflow-shared once it is available Review Comment: Makes sense. I have defined enum in the extra ExecAPI spec now. -- 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]
