baha-bouali commented on code in PR #72752:
URL: https://github.com/apache/airflow/pull/72752#discussion_r4009549608
##########
airflow-core/src/airflow/config_templates/airflow_local_settings.py:
##########
@@ -152,6 +153,67 @@ def _default_conn_name_from(mod_path, hook_name):
return None
+# First provider distribution version whose ``RemoteLogIO`` exposes
``from_config`` *and*
+# registers the scheme in its provider.yaml ``remote-logging:`` block. Named
in the deprecation
+# message so a Deployment Manager knows exactly which upgrade retires the
legacy branch.
+_PROVIDER_DISPATCH_MIN_VERSIONS: dict[str, tuple[str, str]] = {
+ "s3": ("apache-airflow-providers-amazon", "9.33.0"),
+ "cloudwatch": ("apache-airflow-providers-amazon", "9.33.0"),
+ "gs": ("apache-airflow-providers-google", "22.3.0"),
+ "stackdriver": ("apache-airflow-providers-google", "22.3.0"),
+ "wasb": ("apache-airflow-providers-microsoft-azure", "14.1.0"),
+ "oss": ("apache-airflow-providers-alibaba", "3.4.0"),
+ "hdfs": ("apache-airflow-providers-apache-hdfs", "4.13.0"),
+ "elasticsearch": ("apache-airflow-providers-elasticsearch", "6.9.0"),
+ "opensearch": ("apache-airflow-providers-opensearch", "1.12.0"),
+}
+
+# Scheme of ``[logging] remote_base_log_folder``; the key ProvidersManager
dispatches on.
+# Set below when remote logging is enabled.
+_configured_scheme: str = ""
+
+
+def _warn_legacy_remote_logging(remote_log_io: type, scheme: str) -> None:
+ """
+ Warn when this legacy branch, rather than provider dispatch, is what
configures remote logging.
+
+ ``airflow.logging_config._get_logging_config`` imports this module for its
+ ``DEFAULT_LOGGING_CONFIG`` dict on every stock deployment, so the chain
below still runs
+ even when ProvidersManager scheme dispatch has already built the real
handler. Warning
+ unconditionally would therefore fire for every operator, including those
with nothing left
+ to migrate, so a branch warns only when dispatch cannot supersede it:
+
+ * the installed provider predates ``from_config``, and so registers no
scheme; or
+ * ``[logging] remote_base_log_folder`` carries no scheme to dispatch on --
a bare
+ ``wasb-logs`` path, or Elasticsearch/OpenSearch selected through their
``host`` option.
+ """
Review Comment:
Trimmed it to just one-liner.
--
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]