Skip to content

Deprecate implicit REMOTE_TASK_LOG registration in ES task handler#67105

Open
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-elastic-search
Open

Deprecate implicit REMOTE_TASK_LOG registration in ES task handler#67105
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-elastic-search

Conversation

@jason810496
Copy link
Copy Markdown
Member

@jason810496 jason810496 commented May 18, 2026

Why

ElasticsearchTaskHandler.__init__ papers over a missing REMOTE_TASK_LOG in the user's [logging] logging_config_class module by self-registering as the remote task-log reader during dictConfig. That side-effect was the only thing keeping UI log read-back working for users who had swapped in the ES handler via a custom logging config, and it hides the real contract (REMOTE_TASK_LOG must be set at module scope) that the core PR (#67104) documents.

How

  • Emit AirflowProviderDeprecationWarning from the implicit-registration branch in ElasticsearchTaskHandler.__init__, with stacklevel=1 so module-based deprecation filters still match through dictConfig.
  • Add a logging guide under providers/elasticsearch/docs/logging/ that shows the recommended override: set REMOTE_TASK_LOG = ElasticsearchRemoteLogIO(...) at module scope in the user's logging_config_class module, plus an Airflow / provider version compatibility matrix for the supported configurations.
  • Add a provider-local conftest.py that suppresses the new deprecation warning during direct handler construction in unit tests — this mirrors the recommended user pattern (REMOTE_TASK_LOG set at module scope) so the forbidden-warnings plugin does not flag handler instantiation in tests.
  • Add a changelog entry announcing the deprecation.

Was generative AI tooling used to co-author this PR?

…andler

``ElasticsearchTaskHandler.__init__`` papered over a missing
``REMOTE_TASK_LOG`` by self-registering as the remote task-log reader during
``dictConfig``. That side-effect is now deprecated and will be removed in a
future provider release.

- Emit ``AirflowProviderDeprecationWarning`` (``stacklevel=1`` so module-based
  filters match through ``dictConfig``) when the handler falls back to the
  implicit registration path.
- Add a logging guide under ``providers/elasticsearch/docs/logging/`` that
  documents the recommended override: set
  ``REMOTE_TASK_LOG = ElasticsearchRemoteLogIO(...)`` at module scope in your
  ``[logging] logging_config_class`` module.
- Add a provider-local ``conftest.py`` that suppresses the new deprecation
  warning during direct handler construction in unit tests (mirroring the
  recommended user pattern).
@jason810496 jason810496 force-pushed the refactor/logging/clarify-logging-config-class-elastic-search branch from 1a8a574 to 6724899 Compare May 22, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants