Skip to content

fix(athena): tolerate a missing StateChangeReason in _get_query_metadata - #3578

Open
abhishekacharya200 wants to merge 1 commit into
aws:mainfrom
abhishekacharya200:fix/athena-state-change-reason
Open

abhishekacharya200 wants to merge 1 commit into
aws:mainfrom
abhishekacharya200:fix/athena-state-change-reason

Conversation

@abhishekacharya200

Copy link
Copy Markdown
Contributor

Feature or Bugfix

  • Bugfix

Detail

  • athena._utils._get_query_metadata read Status["StateChangeReason"] directly for non-SUCCEEDED payloads. The field is optional in the Athena QueryExecutionStatus shape and can be missing on FAILED/CANCELLED queries, which produced a KeyError instead of QueryFailed. It now uses .get(), consistent with the other call sites in _executions.py.
  • Added mocked unit tests in tests/unit/test_athena_mocked.py (fail before, pass after).

Relates

  • None

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

StateChangeReason is optional in the Athena QueryExecutionStatus shape and can be absent on FAILED or CANCELLED queries. Use .get() so the real QueryFailed is raised instead of a KeyError.
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.

1 participant