amoghrajesh commented on code in PR #58188:
URL: https://github.com/apache/airflow/pull/58188#discussion_r2513598115
##########
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,
+ ]
Review Comment:
Sure, we could do that, although that can probably be done in a follow up,
it is not newly introduced, I am trying to scope the change as minimal as
required only. WDYT?
##########
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:
TBH it won't matter I think. Why do you think it will be an issue / is
brittle?
We do not have a setter defined so I do not think there is a possibility to
edit the sequence
##########
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):
Review Comment:
Sure.
##########
airflow-core/tests/unit/core/test_configuration.py:
##########
@@ -1105,6 +1105,33 @@ def test_order_of_secrets_backends_and_kwargs_on_workers(
for key, value in expected_backend_kwargs.items():
assert getattr(secrets_backend, key) == value
+ def test_default_validators(self):
Review Comment:
Fair ask, let me add those.
--
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]