Add debug logging and fix exception handling in DynamoDB hook#64629
Merged
potiuk merged 1 commit intoapache:mainfrom Apr 2, 2026
Merged
Conversation
- Add debug logging before/after API calls in write_batch_data and get_import_status, following the pattern established in the Airbyte provider (PR apache#51503) - Fix exception chaining: add `from e` to preserve __cause__ so tracebacks show the full causal chain - Fix `raise e` → bare `raise` in get_import_status to avoid adding a misleading extra frame to the traceback - Include import_arn in ImportNotFoundException error message for easier debugging - Rename shadowing variable `describe_import` → `response` - Rename `general_error` → `e` for consistency Part of the Airflow 3 Debugging Improvements initiative.
potiuk
approved these changes
Apr 2, 2026
This was referenced Apr 3, 2026
shivaam
added a commit
to shivaam/airflow
that referenced
this pull request
Apr 3, 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
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Debugging Improvements — Airflow 3 project. I am not sure if the project is still active as the last activity was in Oct 2024
Add debug logging and fix exception handling in the DynamoDB hook
(
write_batch_dataandget_import_status), following the patternestablished by the Airbyte provider in #51503.
Debug logging:
Add DEBUG-level logs before/after API calls — table loading, batch
write start/complete, and
describe_importcalls with response details.Exception handling:
from eexception chaining to preserve__cause__in tracebacksraise ewith bareraiseto avoid extra traceback frameimport_arnin theImportNotFoundExceptionerror messageTesting: Existing tests in
test_dynamodb.pypass unchanged —assertions use exception type checks and substring matching, both
compatible with these changes.
If this approach looks good, I plan to apply the same pattern to
other AWS provider hooks (RDS, SQS, EC2, Lambda, etc.).
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 4.6) following the guidelines