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


##########
airflow/cli/commands/remote_commands/config_command.py:
##########
@@ -64,3 +67,358 @@ def get_value(args):
         print(value)
     except AirflowConfigException:
         pass
+
+
+class ConfigParameter(NamedTuple):
+    """Represents a configuration parameter."""
+
+    section: str
+    option: str
+
+
+@dataclass
+class ConfigChange:
+    """
+    Class representing the configuration changes in Airflow 3.0.
+
+    :param config: The configuration parameter being changed.
+    :param suggestion: A suggestion for replacing or handling the removed 
configuration.
+    :param renamed_to: The new section and option if the configuration is 
renamed.
+    """
+
+    config: ConfigParameter
+    suggestion: str = ""
+    renamed_to: ConfigParameter | None = None
+
+    @property
+    def message(self) -> str:
+        """Generate a message for this configuration change."""
+        if self.renamed_to:
+            if self.config.section != self.renamed_to.section:
+                return (
+                    f"`{self.config.option}` configuration parameter moved 
from `{self.config.section}` section to `"
+                    f"{self.renamed_to.section}` section as 
`{self.renamed_to.option}`."
+                )
+            return (
+                f"`{self.config.option}` configuration parameter renamed to 
`{self.renamed_to.option}` "
+                f"in the `{self.config.section}` section."
+            )
+        return (
+            f"Removed deprecated `{self.config.option}` configuration 
parameter from `{self.config.section}` section. "
+            f"{self.suggestion}"
+        )
+
+
+CONFIGS_CHANGES = [
+    ConfigChange(
+        config=ConfigParameter("admin", "hide_sensitive_variable_fields"),
+        renamed_to=ConfigParameter("core", "hide_sensitive_var_conn_fields"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("admin", "sensitive_variable_fields"),
+        renamed_to=ConfigParameter("core", "sensitive_var_conn_names"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "check_slas"),
+        suggestion="The SLA feature is removed in Airflow 3.0, to be replaced 
with Airflow Alerts in "
+        "future",
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "strict_asset_uri_validation"),
+        suggestion="Asset URI with a defined scheme will now always be 
validated strictly, "
+        "raising a hard error on validation failure.",
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "worker_precheck"),
+        renamed_to=ConfigParameter("celery", "worker_precheck"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "non_pooled_task_slot_count"),
+        renamed_to=ConfigParameter("core", "default_pool_task_slot_count"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "dag_concurrency"),
+        renamed_to=ConfigParameter("core", "max_active_tasks_per_dag"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_conn"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_conn"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_engine_encoding"),
+        renamed_to=ConfigParameter("database", "sql_engine_encoding"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_engine_collation_for_ids"),
+        renamed_to=ConfigParameter("database", "sql_engine_collation_for_ids"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_pool_enabled"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_pool_enabled"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_pool_size"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_pool_size"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_max_overflow"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_max_overflow"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_pool_recycle"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_pool_recycle"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_pool_pre_ping"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_pool_pre_ping"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_schema"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_schema"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "sql_alchemy_connect_args"),
+        renamed_to=ConfigParameter("database", "sql_alchemy_connect_args"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "load_default_connections"),
+        renamed_to=ConfigParameter("database", "load_default_connections"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("core", "max_db_retries"),
+        renamed_to=ConfigParameter("database", "max_db_retries"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("api", "access_control_allow_origin"),
+        renamed_to=ConfigParameter("api", "access_control_allow_origins"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("api", "auth_backend"),
+        renamed_to=ConfigParameter("api", "auth_backends"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("logging", "enable_task_context_logger"),
+        suggestion="Remove TaskContextLogger: Replaced by the Log table for 
better handling of task log "
+        "messages outside the execution context.",
+    ),
+    ConfigChange(
+        config=ConfigParameter("metrics", "metrics_use_pattern_match"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("metrics", "timer_unit_consistency"),
+        suggestion="In Airflow 3.0, the `timer_unit_consistency` setting in 
the `metrics` section is "
+        "removed as it is now the default behaviour. This is done to 
standardize all timer and "
+        "timing metrics to milliseconds across all metric loggers",
+    ),
+    ConfigChange(
+        config=ConfigParameter("metrics", "statsd_allow_list"),
+        renamed_to=ConfigParameter("metrics", "metrics_allow_list"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("metrics", "statsd_block_list"),
+        renamed_to=ConfigParameter("metrics", "metrics_block_list"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("traces", "otel_task_log_event"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("operators", "allow_illegal_arguments"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("webserver", "allow_raw_html_descriptions"),
+    ),
+    ConfigChange(
+        config=ConfigParameter("webserver", "session_lifetime_days"),
+        suggestion="Please use `session_lifetime_minutes`.",
+    ),

Review Comment:
   Do we need this since we already have L246-L249



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