uranusjr commented on code in PR #44908:
URL: https://github.com/apache/airflow/pull/44908#discussion_r1885999498
##########
airflow/cli/commands/remote_commands/config_command.py:
##########
@@ -64,3 +64,349 @@ def get_value(args):
print(value)
except AirflowConfigException:
pass
+
+
+class ConfigChange:
+ """Class representing the configuration changes in Airflow 3.0."""
+
+ def __init__(
+ self, section: str, option: str, suggestion: str = "", renamed_to:
tuple[str, str] | None = None
+ ) -> None:
+ """
+ Initialize a ConfigChange instance.
+
+ :param section: The section of the configuration.
+ :param option: The option within the section that is removed or
deprecated.
+ :param suggestion: A suggestion for replacing or handling the removed
configuration.
+ :param renamed_to: The new section and option if the configuration is
renamed.
+ """
+ self.section = section
+ self.option = option
+ self.suggestion = suggestion
+ self.renamed_to = renamed_to
+
+ def get_message(self) -> str:
+ """Generate a message for this configuration change."""
+ lint_message = f"Removed deprecated `{self.option}` configuration
parameter from `{self.section}` section. {self.suggestion}"
+
+ if self.renamed_to:
+ new_section, new_option = self.renamed_to
+ rename_message = f" Please use `{new_option}` from section
`{new_section}` instead."
+ lint_message = lint_message + rename_message
Review Comment:
I wonder if it’d be nicer if we group the config changes into
1. Moved from one section to another
2. Renamed to another option in the same section
3. Other more complicated changes
And have dedicated messages for the first two.
--
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]