lyso commented on code in PR #29602:
URL: https://github.com/apache/airflow/pull/29602#discussion_r1185609906


##########
airflow/configuration.py:
##########
@@ -390,8 +390,14 @@ def _validate_max_tis_per_query(self) -> None:
 
         """
         # TODO: this type of checking can be generalized like the deprecate 
checking
-        max_tis_per_query = self.getint("scheduler", "max_tis_per_query")
-        parallelism = self.getint("core", "parallelism")
+        try:
+            max_tis_per_query = self.getint("scheduler", "max_tis_per_query")
+            parallelism = self.getint("core", "parallelism")
+        except AirflowConfigException:
+            # in case any of the above config not found, return directly
+            # this could happens in some unit tests

Review Comment:
   Here are the tests failed with this config key not found:
   ```
   FAILED 
tests/core/test_configuration.py::TestConf::test_auth_backends_adds_session - 
airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_values_from_conf
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_env_vars_upgraded_and_removed[old0-new0]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_env_vars_upgraded_and_removed[old1-new1]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_values_from_environ[conf_dict0]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_values_from_environ[conf_dict1]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_sections[old_config]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_sections[old_config_old_env]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_sections[old_env]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   FAILED 
tests/core/test_configuration.py::TestDeprecatedConf::test_deprecated_sections[new_config_old_env]
 - airflow.exceptions.AirflowConfigException: section/key 
[scheduler/max_tis_per_query] not found in config
   ```
   
   These test cases are not using; `conf_vars` to initializing the conf. 
Instead, they initialize conf from a string directly, like `test_conf = 
AirflowConfigParser(default_config="")`. I believe it has been done for 
purpose. 



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