sunank200 commented on code in PR #44908:
URL: https://github.com/apache/airflow/pull/44908#discussion_r1887963331


##########
airflow/cli/commands/remote_commands/config_command.py:
##########
@@ -64,3 +67,390 @@ def get_value(args):
         print(value)
     except AirflowConfigException:
         pass
+
+
+class RenamedTo(NamedTuple):
+    """Represents a configuration parameter that has been renamed."""
+
+    section: str
+    option: str
+
+
+@dataclass
+class ConfigChange:
+    """Class representing the configuration changes in Airflow 3.0."""
+
+    def __init__(
+        self, section: str, option: str, suggestion: str = "", renamed_to: 
RenamedTo | 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
+
+    @property
+    def message(self) -> str:
+        """Generate a message for this configuration change."""
+        if self.renamed_to:
+            if self.section != self.renamed_to.section:
+                return (
+                    f"`{self.option}` configuration parameter moved from 
`{self.section}` section to `"
+                    f"{self.renamed_to.section}` section as 
`{self.renamed_to.option}`."
+                )
+            else:
+                return (
+                    f"`{self.option}` configuration parameter renamed to 
`{self.renamed_to.option}` "
+                    f"in the `{self.section}` section."
+                )
+        else:
+            return (
+                f"Removed deprecated `{self.option}` configuration parameter 
from `{self.section}` section. "
+                f"{self.suggestion}"
+            )

Review Comment:
   Changed it.



##########
airflow/cli/commands/remote_commands/config_command.py:
##########
@@ -64,3 +67,390 @@ def get_value(args):
         print(value)
     except AirflowConfigException:
         pass
+
+
+class RenamedTo(NamedTuple):

Review Comment:
   Changed it



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