Add deferrable mode to DynamoDBValueSensor#69799
Open
harshhh817 wants to merge 1 commit into
Open
Conversation
DynamoDBValueSensor previously only supported poke/reschedule modes, occupying a worker slot while waiting for a DynamoDB attribute value. This adds the standard deferrable path used across the Amazon provider: - deferrable param (defaulting to the operators.default_deferrable config) on DynamoDBValueSensor; when set, execute() defers to a new DynamoDBValueSensorTrigger and execute_complete() validates the event. - DynamoDBValueSensorTrigger polls the item asynchronously. Since aiobotocore only exposes clients (DynamoDBHook is resource-based), the trigger uses a client-type AwsBaseHook and deserializes the typed attribute with boto3's TypeDeserializer before comparing, keeping poke semantics identical to the sync path (ClientError tolerated, string or iterable of strings matched). - Registered the trigger module in provider.yaml/get_provider_info, plus unit tests for the sensor deferral and the trigger. The issue title suggests DynamoDB Streams + SQS, but async polling is the established pattern for amazon provider deferrable sensors (SQS, EC2, ...), so this follows that convention. closes: apache#69051 Signed-off-by: Harsh Gupta <harshgupta93198@gmail.com>
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
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.
Adds the standard deferrable path to
DynamoDBValueSensor, which currently only supports poke/reschedule modes and holds a worker slot while waiting.deferrableparam (default fromoperators.default_deferrable, per provider convention);execute()defers to a newDynamoDBValueSensorTrigger,execute_complete()validates the trigger event.DynamoDBHookis resource-based but aiobotocore only exposes clients, so the trigger uses a client-typeAwsBaseHookwith low-levelget_itemand deserializes the attribute via boto3'sTypeDeserializer— semantics identical to the syncpoke()(ClientError tolerated, single value or iterable matched). This mirrors howEC2StateSensorTriggerhandles the same client/resource split.provider.yaml/get_provider_info.py; docs note added; unit tests for sensor deferral and trigger (serialization + async run paths).The issue proposes DynamoDB Streams + SQS; I went with the async-polling trigger instead since it is the established pattern for the provider's deferrable sensors and requires no extra AWS infrastructure — happy to discuss if maintainers prefer the Streams-based design.
closes: #69051
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.