SEPURI-SAI-KRISHNA opened a new pull request, #71646:
URL: https://github.com/apache/airflow/pull/71646

   All three Neptune triggers declare a `region_name` parameter, document it, 
and read
   `self.region_name` when building their hook — but never forward it to
   `AwsBaseWaiterTrigger.__init__`, which is what actually assigns the 
attribute:
   
   ```python
   def __init__(self, *, db_cluster_id: str, ..., region_name: str | None = 
None, **kwargs):
       super().__init__(
           ...,
           aws_conn_id=aws_conn_id,
           # region_name never passed
           **kwargs,
       )
   
   def hook(self) -> AwsGenericHook:
       return NeptuneHook(aws_conn_id=self.aws_conn_id, 
region_name=self.region_name, ...)
   ```
   
   Because `region_name` is an explicit named parameter it is not swept up by 
the `**kwargs`
   forwarding either — it is captured and discarded, so `self.region_name` is 
always `None`
   and the deferred waiter polls the account's default region.
   
   The failure is quiet and slow: the waiter simply never finds the cluster in 
the region it
   is looking at, so the task burns through `waiter_max_attempts` and then 
fails with a
   message that does not mention regions at all. 
`AwsBaseWaiterTrigger.serialize()` writes
   `self.region_name`, so the wrong value also survives triggerer restarts.
   
   There is a second, independent layer in the operators. Two of the four defer 
sites already
   pass the hook configuration; the two in 
`NeptuneStartDbClusterOperator.execute` and
   `NeptuneStopDbClusterOperator.execute` pass none of it, so fixing only the 
triggers would
   still leave those paths on the default region. Both are brought in line with 
the existing
   sites, which is why `verify` and `botocore_config` are included alongside 
`region_name`.
   
   Affects `NeptuneClusterAvailableTrigger`, `NeptuneClusterStoppedTrigger` and
   `NeptuneClusterInstancesAvailableTrigger`.
   
   Tests cover both layers — that the triggers retain and serialize 
`region_name`, and that
   the operators hand it to the trigger they defer with. All five fail without 
the change.
   
   No newsfragment: this is a provider change, and provider changelogs are 
regenerated from
   `git log` by the release manager.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to