Skip to content

fix(glue): Fix GlueJobOperator verbose logs not showing in deferrable mode#64342

Draft
shivaam wants to merge 1 commit intoapache:mainfrom
shivaam:fix/glue-deferrable-verbose-56535
Draft

fix(glue): Fix GlueJobOperator verbose logs not showing in deferrable mode#64342
shivaam wants to merge 1 commit intoapache:mainfrom
shivaam:fix/glue-deferrable-verbose-56535

Conversation

@shivaam
Copy link
Copy Markdown
Contributor

@shivaam shivaam commented Mar 28, 2026

Re-land of #63086 (reverted by #64340) with corrected error handling.

Changes

When GlueJobOperator runs with deferrable=True and verbose=True, CloudWatch
logs were silently ignored because the trigger inherited the base waiter's run()
method which only polls job status.

Improvements over the original PR:

  • Yield TriggerEvent with error status instead of raising AirflowException
    matches the AwsBaseWaiterTrigger.run() pattern so execute_complete() handles
    errors in the worker, not the triggerer. This eliminates the AirflowException
    import from both the trigger and test files, which was the root cause of the revert.
  • Extract get_glue_log_group_names() and format_glue_logs() as shared helpers in
    hooks/glue.py to eliminate sync/async duplication with GlueJobHook.print_job_logs.

closes: #56535
related: #63086, #64340


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.6)

Generated-by: Claude Code (Opus 4.6) following the guidelines

…bOperator

When using GlueJobOperator with deferrable=True and verbose=True,
CloudWatch logs were silently ignored because the trigger inherited
the base waiter's run() method which only polls job status.

This adds a run() override and _forward_logs() helper to
GlueJobCompleteTrigger that streams logs from both output and error
CloudWatch log groups, matching the format used by the synchronous path.

Key changes:
- Extract get_glue_log_group_names() and format_glue_logs() as shared
  helpers in hooks/glue.py to eliminate sync/async duplication
- Override run() in GlueJobCompleteTrigger for verbose log streaming
- Yield TriggerEvent with error status on failure (matching base class
  pattern) instead of raising AirflowException in the triggerer process
- Add tests for verbose success, failure, max attempts, pagination,
  ResourceNotFoundException, and no-new-events scenarios

closes: apache#56535
@shivaam shivaam force-pushed the fix/glue-deferrable-verbose-56535 branch from 85cb82e to 945c8a3 Compare March 28, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GlueJobOperator in verbose mode do not pull logs correctly

1 participant