Add AthenaSparkSensor - #72229
Draft
SameerMesiah97 wants to merge 2 commits into
Draft
Conversation
SameerMesiah97
force-pushed
the
Add-AthenaSparkSensor
branch
from
August 28, 2026 19:32
87574c2 to
4f5a2c8
Compare
added 2 commits
August 28, 2026 23:03
Athena Spark calculations through the Athena calculation APIs. Add AthenaSparkOperator to submit Spark code to an existing Athena Spark session and wait until the calculation reaches a terminal state. The operator returns calculation metadata including status, session, working directory, and result S3 URIs. Add unit coverage for the new hook methods and operator execution paths, plus provider documentation and an example DAG for Athena Spark usage.
execution until it reaches a terminal state. The sensor uses AthenaHook Spark calculation helpers to poll calculation status, succeeds on completed calculations, continues for in-progress states, and raises on failed, canceled, or unexpected states. Add unit coverage for success, intermediate, and failure sensor states, plus documentation and an example DAG showing how to wait for an existing Athena Spark calculation execution.
SameerMesiah97
force-pushed
the
Add-AthenaSparkSensor
branch
from
August 28, 2026 22:03
4f5a2c8 to
83e9f34
Compare
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.
Description
This change introduces a new sensor,
AthenaSparkSensor, to wait for an existing Amazon Athena Spark calculation execution to reach a terminal state.The sensor delegates to
AthenaHookSpark calculation helpers to poll the calculation status. It succeeds when the calculation reachesCOMPLETED, continues poking while the calculation is in an in-progress state, and raises when the calculation reaches a failed, canceled, or unexpected state.Rationale
Amazon Athena Spark calculations are identified by a
calculation_execution_idafter they are submitted. WhileAthenaSparkOperatorcan submit Spark code and wait for completion, users may also need to monitor calculations started outside the operator, for example by another task or by an external system.Adding
AthenaSparkSensorgives DAG authors a provider-native way to wait on an existing Athena Spark calculation without writing custom polling logic around boto3.Tests
Added unit tests verifying that:
CREATING,CREATED,QUEUED, andRUNNINGcontinue waiting.Example DAG
Updated the Athena Spark example DAG to demonstrate waiting for an existing Athena Spark calculation execution using
AthenaSparkSensor.Documentation
Added documentation for
AthenaSparkSensor, including its expectedcalculation_execution_idinput and an example usage snippet.Backwards Compatibility
This is a new sensor and does not modify existing Athena sensor behavior. No breaking changes are introduced.
Acknowledgements
This change builds on the Athena Spark provider support previously explored in PR #66576 by @Andisha2004 which proposed adding an Athena Spark hook, sensor, and operator to the Amazon provider. This PR carries that direction forward with a narrower initial scope focused on
AthenaSparkSensormethods, along with updated tests, documentation, and an example DAG aligned with current provider conventions.Was generative AI tooling used to co-author this PR?
Generated-by: [GPT 5.5] following the guidelines