Repository navigation
Description
Important
Status — please read before starting work on this issue.
Almost everything in the tables below is already covered by an open PR. Please
comment here before opening a new one, so we don't duplicate each other.
| scope | covered by | state |
|---|---|---|
The AwsBaseWaiterTrigger base-class fix, plus the call sites and trigger signatures for bedrock, comprehend, dms, ecs, eks, emr, glue, mwaa, neptune_analytics, rds and ssm |
#72171 | open |
| batch (#72278) | #72449 | open |
| opensearch_serverless (#72280) | #72472 | open |
| sagemaker_unified_studio_notebook (#72279) | #72453 | merged |
SageMakerNotebookOperator (aws/operators/sagemaker_unified_studio.py:175) is
out of scope: it is a plain BaseOperator and carries none of the three
parameters. The Shape B row for it is a false positive.
That leaves nothing unclaimed. If you would like to help, a review of #72171 is
worth much more than a new PR right now. If you have already started something,
please say so here and we will make room for it rather than duplicate it.
Under which category would you file this issue?
Providers
Apache Airflow version
3.3.1
What happened and how to reproduce it?
An AwsBaseOperator / AwsBaseSensor subclass always carries
region_name, verify and botocore_config, the base class sets all three
in __init__. When the task defers, the trigger builds its own hook. Any
of the three not explicitly forwarded to the trigger is lost, so the deferred
half of the task talks to AWS with different settings than the synchronous
half:
region_name— the triggerer falls back to the boto3 default region, so
the task polls a different region than the one it started work in and waits
on a resource that isn't there.verify— SSL certificate verification silently returns to the default.
A deployment that deliberately setverify=False, or pointed it at a
private CA bundle, loses that in the triggerer.botocore_config— custom timeouts, retry policies and connection limits
are dropped, so the triggerer polls with default botocore behaviour.
None of this fails loudly. The task simply behaves differently once it defers.
Scope
An AST sweep of every self.defer(trigger=...) call in the provider finds
110 defer sites:
| sites | |
|---|---|
| forward all three | 49 |
forward only region_name |
18 |
| forward none of the three | 43 |
| remaining to fix | 61 |
By service:
| service | passes none | passes only region_name |
|---|---|---|
| emr | 13 | — |
| bedrock | 12 | — |
| dms | 7 | — |
| comprehend | 4 | — |
| glue | 4 | 2 |
| opensearch_serverless | 1 | — |
| sagemaker_unified_studio | 1 | — |
| sagemaker_unified_studio_notebook | 1 | — |
| eks | — | 9 |
| rds | — | 4 |
| ecs | — | 2 |
| batch | — | 1 |
Why this should not continue service-by-service
The remaining sites split into two very different shapes:
- 7 sites can be fixed at the call site, the trigger already names all
three (2 sites), or takes**kwargsthat reachAwsBaseWaiterTrigger
(5 sites). - 54 sites cannot. Their trigger subclasses have closed
__init__
signatures that never accept the parameters, andhook()implementations
that build the hook fromaws_conn_idalone. Fixing those service by
service means editing 54 call sites and 54 trigger signatures.
So the bulk of the remaining work is one structural change, not more
per-service PRs.
Proposed fix
Give AwsBaseWaiterTrigger a default hook() driven by a hook_class
attribute, the same shape as AwsBaseHookMixin._hook_parameters, so the
hook is built from the serialized parameters in one place instead of in each
subclass. Add one parametrized invariant test over the deferrable operators
asserting that a deferred trigger's serialized payload carries the operator's
region_name / verify / botocore_config, so a new operator that forgets
them fails in CI rather than in production.
The 7 call-site-only sites can go in the same change or a small follow-up.
Reproduce
Run any deferrable operator from the table with a non-default region_name,
verify or botocore_config, and inspect the trigger it defers with:
with pytest.raises(TaskDeferred) as deferred:
operator.execute(None)
# the operator's settings are absent from the serialized payload
assert deferred.value.trigger.serialize()[1]Already fixed
- Use the configured region for deferred Neptune cluster tasks #71646 — neptune (2 sites)
- Use the operator's AWS settings for deferred SageMaker tasks #71857 — sagemaker (7 sites)
- Use the operator's AWS settings for deferred Neptune, MWAA, SSM tasks #72098 — neptune_analytics, mwaa, ssm (12 sites) — PR open, and also carried by Build deferred AWS hooks from the operator's own settings #72171
- Fix SageMaker Unified Studio trigger hook config #72453 — sagemaker_unified_studio_notebook (1 site)
What you think should happen instead?
A deferred task should reach AWS with the same region, SSL verification setting and botocore configuration as the synchronous path. Whether a task
defers is an execution detail; it should not change which endpoint the task talks to or how it authenticates to it.
Operating System
Not Applicable
Deployment
Other
Apache Airflow Provider(s)
amazon
Versions of Apache Airflow Providers
apache-airflow-providers-amazon — audit run against main (9.35.1)
Official Helm Chart version
Not Applicable
Kubernetes Version
Not Applicable
Helm Chart configuration
No response
Docker Image customizations
No response
Anything else?
Shape A — trigger already names all three; operator-side fix only (2 sites)
| file:line | operator / sensor | trigger | already passes |
|---|---|---|---|
aws/operators/glue.py:361 |
GlueJobOperator |
GlueJobCompleteTrigger |
region_name |
aws/sensors/glue.py:99 |
GlueJobSensor |
GlueJobCompleteTrigger |
region_name |
Shape B — trigger takes **kwargs; operator-side fix only (3 sites)
| file:line | operator / sensor | trigger | already passes |
|---|---|---|---|
aws/operators/sagemaker_unified_studio.py:175 |
SageMakerNotebookOperator |
SageMakerNotebookJobTrigger |
— |
aws/operators/sagemaker_unified_studio_notebook.py:191 |
SageMakerUnifiedStudioNotebookOperator |
SageMakerUnifiedStudioNotebookTrigger |
— |
aws/sensors/batch.py:99 |
BatchSensor |
BatchJobTrigger |
region_name |
Shape C — trigger signature is closed; needs the base-class fix (55 sites)
| file:line | operator / sensor | trigger | already passes |
|---|---|---|---|
aws/operators/bedrock.py:206 |
BedrockCreateAgentRuntimeOperator |
BedrockAgentRuntimeReadyTrigger |
— |
aws/operators/bedrock.py:390 |
BedrockDeleteAgentRuntimeOperator |
BedrockAgentRuntimeDeletedTrigger |
— |
aws/operators/bedrock.py:542 |
BedrockCustomizeModelOperator |
BedrockCustomizeModelCompletedTrigger |
— |
aws/operators/bedrock.py:631 |
BedrockCreateProvisionedModelThroughputOperator |
BedrockProvisionModelThroughputCompletedTrigger |
— |
aws/operators/bedrock.py:804 |
BedrockCreateKnowledgeBaseOperator |
BedrockKnowledgeBaseActiveTrigger |
— |
aws/operators/bedrock.py:989 |
BedrockIngestDataOperator |
BedrockIngestionJobTrigger |
— |
aws/operators/bedrock.py:1308 |
BedrockBatchInferenceOperator |
BedrockBatchInferenceCompletedTrigger |
— |
aws/operators/comprehend.py:189 |
ComprehendStartPiiEntitiesDetectionJobOperator |
ComprehendPiiEntitiesDetectionJobCompletedTrigger |
— |
aws/operators/comprehend.py:338 |
ComprehendCreateDocumentClassifierOperator |
ComprehendCreateDocumentClassifierCompletedTrigger |
— |
aws/operators/dms.py:260 |
DmsModifyTaskOperator |
DmsTaskModifyCompleteTrigger |
— |
aws/operators/dms.py:762 |
DmsDeleteReplicationConfigOperator |
DmsReplicationTerminalStatusTrigger |
— |
aws/operators/dms.py:773 |
DmsDeleteReplicationConfigOperator |
DmsReplicationDeprovisionedTrigger |
— |
aws/operators/dms.py:794 |
DmsDeleteReplicationConfigOperator |
DmsReplicationConfigDeletedTrigger |
— |
aws/operators/dms.py:948 |
DmsStartReplicationOperator |
DmsReplicationDeprovisionedTrigger |
— |
aws/operators/dms.py:991 |
DmsStartReplicationOperator |
DmsReplicationCompleteTrigger |
— |
aws/operators/dms.py:1098 |
DmsStopReplicationOperator |
DmsReplicationStoppedTrigger |
— |
aws/operators/eks.py:358 |
EksCreateClusterOperator |
EksCreateClusterTrigger |
region_name |
aws/operators/eks.py:408 |
EksCreateClusterOperator |
EksDeleteClusterTrigger |
region_name |
aws/operators/eks.py:441 |
EksCreateClusterOperator |
EksCreateFargateProfileTrigger |
region_name |
aws/operators/eks.py:454 |
EksCreateClusterOperator |
EksCreateNodegroupTrigger |
region_name |
aws/operators/eks.py:598 |
EksCreateNodegroupOperator |
EksCreateNodegroupTrigger |
region_name |
aws/operators/eks.py:712 |
EksCreateFargateProfileOperator |
EksCreateFargateProfileTrigger |
region_name |
aws/operators/eks.py:802 |
EksDeleteClusterOperator |
EksDeleteClusterTrigger |
region_name |
aws/operators/eks.py:944 |
EksDeleteNodegroupOperator |
EksDeleteNodegroupTrigger |
region_name |
aws/operators/eks.py:1036 |
EksDeleteFargateProfileOperator |
EksDeleteFargateProfileTrigger |
region_name |
aws/operators/emr.py:234 |
EmrAddStepsOperator |
EmrAddStepsTrigger |
— |
aws/operators/emr.py:865 |
EmrCreateJobFlowOperator |
EmrCreateJobFlowTrigger |
— |
aws/operators/emr.py:1076 |
EmrTerminateJobFlowOperator |
EmrTerminateJobFlowTrigger |
— |
aws/operators/emr.py:1174 |
EmrServerlessCreateApplicationOperator |
EmrServerlessCreateApplicationTrigger |
— |
aws/operators/emr.py:1219 |
EmrServerlessCreateApplicationOperator |
EmrServerlessStartApplicationTrigger |
— |
aws/operators/emr.py:1365 |
EmrServerlessStartJobOperator |
EmrServerlessStartApplicationTrigger |
— |
aws/operators/emr.py:1423 |
EmrServerlessStartJobOperator |
EmrServerlessStartJobTrigger |
— |
aws/operators/emr.py:1682 |
EmrServerlessStopApplicationOperator |
EmrServerlessCancelJobsTrigger |
— |
aws/operators/emr.py:1705 |
EmrServerlessStopApplicationOperator |
EmrServerlessStopApplicationTrigger |
— |
aws/operators/emr.py:1735 |
EmrServerlessStopApplicationOperator |
EmrServerlessStopApplicationTrigger |
— |
aws/operators/emr.py:1828 |
EmrServerlessDeleteApplicationOperator |
EmrServerlessDeleteApplicationTrigger |
— |
aws/operators/glue.py:751 |
GlueDataQualityRuleSetEvaluationRunOperator |
GlueDataQualityRuleSetEvaluationRunCompleteTrigger |
— |
aws/operators/glue.py:899 |
GlueDataQualityRuleRecommendationRunOperator |
GlueDataQualityRuleRecommendationRunCompleteTrigger |
— |
aws/operators/rds.py:646 |
RdsCreateDbInstanceOperator |
RdsDbAvailableTrigger |
region_name |
aws/operators/rds.py:736 |
RdsDeleteDbInstanceOperator |
RdsDbDeletedTrigger |
region_name |
aws/operators/rds.py:820 |
RdsStartDbOperator |
RdsDbAvailableTrigger |
region_name |
aws/operators/rds.py:924 |
RdsStopDbOperator |
RdsDbStoppedTrigger |
region_name |
aws/sensors/bedrock.py:155 |
BedrockCustomizeModelCompletedSensor |
BedrockCustomizeModelCompletedTrigger |
— |
aws/sensors/bedrock.py:225 |
BedrockProvisionModelThroughputCompletedSensor |
BedrockProvisionModelThroughputCompletedTrigger |
— |
aws/sensors/bedrock.py:294 |
BedrockKnowledgeBaseActiveSensor |
BedrockKnowledgeBaseActiveTrigger |
— |
aws/sensors/bedrock.py:381 |
BedrockIngestionJobSensor |
BedrockIngestionJobTrigger |
— |
aws/sensors/comprehend.py:132 |
ComprehendStartPiiEntitiesDetectionJobCompletedSensor |
ComprehendPiiEntitiesDetectionJobCompletedTrigger |
— |
aws/sensors/comprehend.py:217 |
ComprehendCreateDocumentClassifierCompletedSensor |
ComprehendCreateDocumentClassifierCompletedTrigger |
— |
aws/sensors/emr.py:520 |
EmrJobFlowSensor |
EmrTerminateJobFlowTrigger |
— |
aws/sensors/emr.py:648 |
EmrStepSensor |
EmrStepSensorTrigger |
— |
aws/sensors/glue.py:207 |
GlueDataQualityRuleSetEvaluationRunSensor |
GlueDataQualityRuleSetEvaluationRunCompleteTrigger |
— |
aws/sensors/glue.py:327 |
GlueDataQualityRuleRecommendationRunSensor |
GlueDataQualityRuleRecommendationRunCompleteTrigger |
— |
aws/sensors/opensearch_serverless.py:115 |
OpenSearchServerlessCollectionActiveSensor |
OpenSearchServerlessCollectionActiveTrigger |
— |
aws/operators/ecs.py:138 |
EcsCreateClusterOperator |
ClusterActiveTrigger |
region_name |
aws/operators/ecs.py:215 |
EcsDeleteClusterOperator |
ClusterInactiveTrigger |
region_name |
Dynamic trigger selection; needs the base-class fix (1 sites)
| file:line | operator / sensor | trigger | already passes |
|---|---|---|---|
aws/sensors/bedrock.py:490 |
BedrockBatchInferenceSensor |
trigger_class |
— |
The counts come from parsing every self.defer(trigger=...) call with ast, recording which of the three keywords the trigger construction receives, then reading each trigger class's __init__ signature to classify the fix shape.
Drafted-by: Claude Code (Opus 5); reviewed by @SEPURI-SAI-KRISHNA before posting
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
jroachgolf84 commentedon Aug 27, 2026
@SEPURI-SAI-KRISHNA - does your PR address each of these Operators/Sensors that you mentioned?
jroachgolf84 commentedon Aug 27, 2026
If not, could we use this as part of our Contibutors Workshop to allow for users to make their first contribution?
rjgoyln commentedon Aug 27, 2026
Hi @SEPURI-SAI-KRISHNA, thanks for driving this!
I ran an AST sweep on
mainand wanted to share two important findings to help shape the rollout:1. Critical Rollout Constraint (Crash Risk)
Because the triggerer deserializes via
trigger_class(**deserialised_kwargs), we must update the trigger__init__signatures to accept these parameters before or alongside the operator fixes.If an operator starts forwarding a real
region_nameto a trigger that hasn't been updated to accept it, the triggerer will hard-crash with aTypeError(currently, they don't crash becauseNonevalues are dropped from the payload).2. Scope Corrections
EmrContainerOperator(line 642) andEmrContainerSensor(line 323) were missed because their triggers are built inside conditional expressions.SageMakerNotebookOperatoris a plainBaseOperatorthat lacksregion_name,verify, orbotocore_config. It should be excluded from this scope.SEPURI-SAI-KRISHNA commentedon Aug 27, 2026
Thanks, the EMR catch is real and I've fixed it.
EmrContainerOperator/EmrContainerSensor: you're right, and the miss was worse than one site each. Both build the trigger inside a conditional expression, so there are two constructions per site, four in total, all passing none of the three. My sweep only looked attrigger=<Call>and skippedast.IfExpentirely, which means my invariant test would have skipped them too. The test now resolves thetrigger=expression to every construction it can evaluate to, and a defer site whose trigger is a bare reference is asserted against an explicit allowlist rather than silently ignored. That last part catches one more:EksPodOperatorpasses a pre-builtEksPodTrigger, which is aKubernetesPodTriggerand out of scope.EmrContainerTriggeralso needed its hook'svirtual_cluster_id, so it overrides_hook_parametersrather than relying on the default, which is the escape hatch the base class keeps for exactly this.SageMakerNotebookOperator: agreed, excluded. I'd reached the same conclusion from the trigger side,SageMakerNotebookJobTriggeris a plainBaseTriggerwhose hook is addressed by execution name, and your reason from the operator side is the same boundary.Ordering / crash risk: agreed, and it's why this is one PR rather than a series. The trigger signatures and the call sites move together, so there is no intermediate commit where an operator forwards a parameter its trigger cannot accept.
Signature count: we're measuring different things, and your number is the right one for classes. My 54 was defer sites that could not be fixed at the call site. Counting classes instead: of the 45 this PR touches, 31 accept none of the three, 12 already accept
region_name, and 2 accept some other subset. So ~30 fully closed is correct; I should have said "sites" more clearly in the issue.Net effect after the fix: 113 of 114 trigger constructions forward the hook configuration, the remaining one being the SageMaker case above.
Drafted-by: Claude Code (Opus 5); reviewed by @SEPURI-SAI-KRISHNA before posting
SEPURI-SAI-KRISHNA commentedon Aug 27, 2026
It does, yes, I have it working locally across all of them: 113 of 114 defer sites, the one exception being
SageMakerNotebookOperator, which is a different shape and out of scope.But I'd rather not take the whole issue off the table for the workshop, and it splits cleanly if that's more useful to you.
The reason the remaining sites can't just be fixed one call at a time is that most of the trigger subclasses never accept
region_name/verify/botocore_configat all, and each builds its own hook fromaws_conn_idalone. So I'd propose landing only the mechanism:AwsBaseWaiterTriggerbuilds the hook itself from the parameters it already serializes, driven by anaws_hook_classattribute, the same arrangementAwsBaseHookMixingives the operators.That's roughly 200 lines and no behaviour change on its own. Each service then becomes a self-contained first contribution: set
aws_hook_classon the triggers, widen their__init__, pass the three parameters at the call sites, delete one entry from the allowlist and watch that service's tests go green.Sized by defer sites and trigger classes:
The small ones at the bottom are a gentle first PR; emr and bedrock are better suited to someone who has already done one.
Happy either way, say the word and I'll open it as the mechanism only, or as the complete fix if you'd rather just have it done.
Drafted-by: Claude Code (Opus 5); reviewed by @SEPURI-SAI-KRISHNA before posting
jroachgolf84 commentedon Aug 27, 2026
@SEPURI-SAI-KRISHNA - thanks for the write up! Do you mind if I steal
batch,opensearch_serverless, andsagemarker_unified_studio_notebookfor the Contributor's Workshop? I will create sub-issues for them if it's alright by you.Really appreciate this! The Airflow Community thanks you!
SEPURI-SAI-KRISHNA commentedon Aug 27, 2026
Please do, and thanks for picking them up. I've pulled those three back out of my branch, so the PR I open won't touch them.
To make the sub-issues easier to write, one thing worth knowing: those three are not the same size, because two of the triggers already accept the parameters and only the call site is wrong.
sensors/batch.py:101->BatchJobTrigger, call site only.BatchJobTrigger.__init__takes**kwargsand forwards toAwsBaseWaiterTrigger, andoperators/batch.py:242already passes all three today. The sensor just passesregion_nameand stops. Addverify=self.verifyandbotocore_config=self.botocore_configand it's done.operators/sagemaker_unified_studio_notebook.py:192->SageMakerUnifiedStudioNotebookTrigger, call site only, same reason. That trigger also takes**kwargs, and itshook()already reads all three offself; they're just never populated because the operator doesn't send them. Three lines at the call site.sensors/opensearch_serverless.py:116->OpenSearchServerlessCollectionActiveTrigger, the full shape, and the better teaching example. The trigger's__init__is closed (no**kwargs), and itshook()isOpenSearchServerlessHook(aws_conn_id=self.aws_conn_id), so it discards the configuration even if you pass it. This one needs the signature widened,aws_hook_class = OpenSearchServerlessHookset, the bespokehook()deleted, and then the call site fixed.So if you want an ordering: batch and sagemaker are genuinely a first-PR size, opensearch_serverless is the one that shows the whole pattern.
On the mechanism side, the PR carries an allowlist in the invariant test:
Each task is then: make the change, delete your line, watch the test go green. The test asserts that an entry is still needed, so a stale line fails the suite rather than quietly masking a site, the allowlist can't outlive the work it tracks. That should keep the three sub-issues independent of each other and of my PR.
I'll link the PR here once it's up.
Drafted-by: Claude Code (Opus 5); reviewed by @SEPURI-SAI-KRISHNA before posting
SEPURI-SAI-KRISHNA commentedon Aug 27, 2026
PR is up: #72171. It carries the PENDING_MIGRATION allowlist with those three entries, so the sub-issues can be worked independently once it lands.
jroachgolf84 commentedon Aug 30, 2026
Thanks again, @SEPURI-SAI-KRISHNA - I've created these three issues for the Contributors Workshop:
BatchJobTriggerfrom theBatchSensor#72278SageMakerUnifiedStudioNotebookTrigger#72279OpenSearchServerlessCollectionActiveTrigger#72280jroachgolf84 commentedon Sep 2, 2026
This issue is now open for contribution. Please feel free to create a PR!
zohaibfast99 commentedon Sep 5, 2026
I'd like to take the two Shape A call sites (aws/operators/glue.py:361 and aws/sensors/glue.py:99)
GlueJobCompleteTrigger already accepts `egion_name, verify and botocore_config and already forwards all three in its hook(), so those two are a call-site-only fix that works either side of #72171. PR coming shortly.
One thing I noticed while tracing it: the ECS rows under "Shape B (operator-side fix only)" may need a second look. ClusterActiveTrigger.hook() and ClusterInactiveTrigger.hook() return `EcsHook(aws_conn_id=self.aws_conn_id, region_name=self.region_name), so although **kwargs reaches AwsBaseWaiterTrigger and the parameters would serialize, the hook is still built without them. Those two look like they need the hook() widened as well, unless #72171 lands first!
SEPURI-SAI-KRISHNA commentedon Sep 5, 2026
On the ECS rows, you're right, and the "operator-side fix only" label on them is wrong.
Both triggers do take
**kwargsand forward toAwsBaseWaiterTrigger, soverifyandbotocore_configserialize and round-trip fine. But each one then overrideshook():So the parameters arrive on the trigger and are dropped when the hook is built. Passing them at the call site alone changes nothing observable. Those two rows belong under Shape C, not Shape B, I grouped the table by whether the trigger's
__init__accepts the parameters, when the question that actually matters is whetherhook()consumes them. I'll correct the table.Your caveat is right too: #72171 already covers both. It sets
aws_hook_class = EcsHookonClusterActiveTriggerandClusterInactiveTriggerand deletes thehook()override, so the base class builds the hook from all three serialized parameters.On glue, a heads-up so a reviewer doesn't meet it cold: #72557 and #72171 overlap on the same lines. #72171 touches
operators/glue.pyandsensors/glue.pyfor the two Shape A sites you picked up, and also widenstriggers/glue.py.Worth knowing that the two Shape A sites aren't all of glue.
GlueDataQualityRuleSetEvaluationRunSensorandGlueDataQualityRuleRecommendationRunSensoralso defer, and their triggers are Shape C, closed__init__signatures that never accept the three parameters, so those two can't be fixed at the call site and aren't covered by #72557.Your PR is smaller and self-contained, so I'm happy for it to land first; I'll rebase #72171 and drop the four overlapping lines. Nothing needed from you, just flagging the overlap.
Separately, and not aimed at anyone in particular: I've added a status block at the top of the issue. Between #72171, #72449 and #72472 the sites in those tables are now all spoken for, so if you are reading this and thinking of picking up a service, please comment here first. I would much rather make room for you than have you write something that ends up closed as a duplicate.
Drafted-by: Claude Code (Opus 5); reviewed by @SEPURI-SAI-KRISHNA before posting
zohaibfast99 commentedon Sep 5, 2026