dada-engineer commented on code in PR #53884:
URL: https://github.com/apache/airflow/pull/53884#discussion_r2309160978
##########
airflow-core/src/airflow/configuration.py:
##########
@@ -808,6 +809,19 @@ def _upgrade_postgres_metastore_conn(self):
old_env_var = self._env_var_name("core", key)
os.environ.pop(old_env_var, None)
+ def _strip_trailing_slash_from_base_url(self):
+ """Validate that api base_url config does not end with `/`."""
+ key = "base_url"
+ base_url = self.get("api", key, fallback="")
+ if base_url and base_url.endswith("/"):
+ self.upgraded_values[("api", key)] = base_url
+ new_base_url = base_url.rstrip("/")
+ self._update_env_var(section="api", name=key,
new_value=new_base_url)
+ # if the old value is set via env var, we need to wipe it
+ # otherwise, it'll "win" over our adjusted value
+ old_env_var = self._env_var_name("core", key)
Review Comment:
Ah I didin't know this. Saw this code in another config modifying code and
thought I need this. I'll remove this then 👍🏻
--
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]