Skip to content

Deprecate implicit REMOTE_TASK_LOG registration in OS task handler#67106

Merged
jason810496 merged 1 commit into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-open-search
May 22, 2026
Merged

Deprecate implicit REMOTE_TASK_LOG registration in OS task handler#67106
jason810496 merged 1 commit into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-open-search

Conversation

@jason810496
Copy link
Copy Markdown
Member

@jason810496 jason810496 commented May 18, 2026

Why

OpensearchTaskHandler.__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 OS 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 OpensearchTaskHandler.__init__, with stacklevel=1 so module-based deprecation filters still match through dictConfig.
  • Update the OpenSearch logging guide (providers/opensearch/docs/logging/index.rst) to set REMOTE_TASK_LOG = OpensearchRemoteLogIO(...) at module scope in the user's logging_config_class module instead of relying on the deprecated self-registration.
  • 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?

``OpensearchTaskHandler.__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.
- Update the OpenSearch logging guide to set
  ``REMOTE_TASK_LOG = OpensearchRemoteLogIO(...)`` at module scope in the
  ``[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 merged commit 8388bb8 into apache:main May 22, 2026
104 checks passed
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