uranusjr commented on code in PR #32572:
URL: https://github.com/apache/airflow/pull/32572#discussion_r1266252194


##########
airflow/configuration.py:
##########
@@ -378,6 +379,25 @@ def validate(self):
         self._upgrade_postgres_metastore_conn()
         self.is_validated = True
 
+    def _validate_max_tis_per_query(self) -> None:
+        """
+        Check if config ``scheduler.max_tis_per_query`` is not greater than 
``core.parallelism``.
+        If not met, a warning message is printed to guide the user to correct 
it.
+
+        More info: https://github.com/apache/airflow/pull/32572
+        """
+        max_tis_per_query = self.getint("scheduler", "max_tis_per_query")
+        parallelism = self.getint("core", "parallelism")
+
+        if max_tis_per_query > parallelism:
+            warnings.warn(
+                f"Config value 
`scheduler.max_tis_per_query`(value:{max_tis_per_query}) "
+                f"should NOT be greater than 
`core.parallelism`(value:{parallelism}). "
+                "Will now use `core.parallelism` as the max task instances per 
query "
+                "instead of specified value.",

Review Comment:
   ```suggestion
                   f"Config scheduler.max_tis_per_query (value: 
{max_tis_per_query}) "
                   f"should NOT be greater than core.parallelism (value: 
{parallelism}). "
                   "Will now use core.parallelism as the max task instances per 
query "
                   "instead of specified value.",
   ```



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