Copilot commented on code in PR #66370:
URL: https://github.com/apache/airflow/pull/66370#discussion_r3213028482
##########
airflow-ctl/src/airflowctl/ctl/commands/config_command.py:
##########
@@ -86,12 +86,13 @@ def message(self, api_client=NEW_API_CLIENT) -> str | None:
f"`{self.config.option}` configuration parameter renamed to
`{self.renamed_to.option}` "
f"in the `{self.config.section}` section."
)
- if self.was_removed and not self.remove_if_equals:
- return (
- f"Removed{' deprecated' if self.was_deprecated else ''}
`{self.config.option}` configuration parameter "
- f"from `{self.config.section}` section."
- f"{self.suggestion}"
- )
+ if self.was_removed:
+ if self.remove_if_equals is None:
+ return self._removed_message()
+
+ value = self._get_option_value(api_client.configs.list())
+ if value == str(self.remove_if_equals):
Review Comment:
`ConfigChange.message()` calls `api_client.configs.list()` to re-fetch the
full config (potentially over HTTP) for `remove_if_equals` handling, even
though `lint()` already fetched `all_configs` and located the option before
calling `message()`. This adds avoidable round-trips/work per rule, and in the
current flow can be multiplied further when `message()` is invoked more than
once. Consider passing the already-fetched `Config` (or the current option
value) into `message()` so the check uses local data instead of issuing another
`list()` call.
--
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]