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


##########
airflow-core/src/airflow/configuration.py:
##########
@@ -758,10 +758,29 @@ def restore_core_default_configuration(self) -> None:
         self._default_values = 
create_default_config_parser(self.configuration_description)
         self._providers_configuration_loaded = False
 
+    @property
+    def _validators(self) -> list[Callable[[], None]]:
+        """
+        Return list of validators defined on a config parser class.
+
+        Subclasses can override this to customize the validators that are run 
during validation on the
+        config parser instance.
+        """
+        return [
+            self._validate_sqlite3_version,
+            self._validate_enums,
+            self._validate_deprecated_values,
+            self._upgrade_postgres_metastore_conn,
+        ]
+
     def validate(self):
-        self._validate_sqlite3_version()
-        self._validate_enums()
+        """Run all registered validators."""
+        for validator in self._validators:
+            validator()
+        self.is_validated = True
 
+    def _validate_deprecated_values(self):

Review Comment:
   Handled.



##########
airflow-core/src/airflow/configuration.py:
##########
@@ -758,10 +758,29 @@ def restore_core_default_configuration(self) -> None:
         self._default_values = 
create_default_config_parser(self.configuration_description)
         self._providers_configuration_loaded = False
 
+    @property
+    def _validators(self) -> list[Callable[[], None]]:

Review Comment:
   Fair point, but I do not really see a use case why we should do it. It 
simply feels like over-engineering.
   
   Subclasses are going to override the `_validators` property and it will be 
used internally only in the parser class methods, if they really want to mutate 
it, they could just override the method: `_validators` 



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