Skip to content

Improve debuggability of SQS, Lambda, EC2, and RDS hooks#64661

Merged
potiuk merged 1 commit intoapache:mainfrom
shivaam:fix/aws-hooks-debug-logging-exception-handling
Apr 6, 2026
Merged

Improve debuggability of SQS, Lambda, EC2, and RDS hooks#64661
potiuk merged 1 commit intoapache:mainfrom
shivaam:fix/aws-hooks-debug-logging-exception-handling

Conversation

@shivaam
Copy link
Copy Markdown
Contributor

@shivaam shivaam commented Apr 3, 2026

Follow-up to #64629 (DynamoDB hook), applying the same debug logging
and exception handling pattern to four more AWS provider hooks.

Debug logging — adds self.log.debug() before/after API calls,
following the Airbyte provider pattern (#51503):

Hook Methods
SQS create_queue, send_message, asend_message
Lambda invoke_lambda, create_lambda
EC2 get_instance, stop/start/terminate_instances, get_instance_state_async, wait_for_state
RDS All 6 get_*_state methods

All logs are at DEBUG level — no-ops unless explicitly enabled.

Exception handling (RDS only):

  • Add from e exception chaining to all 6 raise AirflowNotFoundException(e)
    to preserve __cause__ in tracebacks
  • Replace raise e with bare raise in get_export_task_state and
    get_event_subscription_state to avoid adding a misleading extra
    frame to the traceback

Testing: All 53 existing tests across the four hook test files
pass unchanged.

Part of the Debugging Improvements — Airflow 3 initiative.

related: #64629, #51503


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

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

- Add debug logging before/after API calls in all four hooks,
  following the pattern from the Airbyte provider (apache#51503) and
  DynamoDB hook (apache#64629)
- Fix `raise e` → bare `raise` in RDS hook (get_export_task_state,
  get_event_subscription_state) to avoid misleading extra traceback
  frames
@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Apr 3, 2026
@shivaam shivaam marked this pull request as ready for review April 3, 2026 07:30
@shivaam shivaam requested a review from o-nikolas as a code owner April 3, 2026 07:30
@potiuk potiuk merged commit 58e5d02 into apache:main Apr 6, 2026
147 of 150 checks passed
shivaam added a commit to shivaam/airflow that referenced this pull request Apr 8, 2026
- Add debug logging before/after API calls in all four hooks,
  following the pattern from the Airbyte provider (apache#51503) and
  DynamoDB hook (apache#64629)
- Fix `raise e` → bare `raise` in RDS hook (get_export_task_state,
  get_event_subscription_state) to avoid misleading extra traceback
  frames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants