Skip to content

Rename Neptune operator db_cluster_id argument to cluster_id - #70491

Open
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:fix-neptune-template-fields
Open

Rename Neptune operator db_cluster_id argument to cluster_id#70491
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:fix-neptune-template-fields

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Part of the template-field validation burn-down tracked in #70296.

NeptuneStartDbClusterOperator and NeptuneStopDbClusterOperator declare cluster_id in template_fields but expose the value as the db_cluster_id constructor argument, assigning self.cluster_id = db_cluster_id in __init__ — which the validate-operators-init check flags. Per review feedback, this renames the argument to cluster_id (rather than renaming the attribute as in the first iteration of this PR), so the templated attribute and template_fields entry stay exactly as they are on main and existing Dags templating the attribute are unaffected.

Breaking change: Dags passing db_cluster_id= to these two operators must switch to cluster_id=, and now fail loudly with a TypeError at construction time. A note was added to the provider changelog. The db_cluster_id keys in the operators' XCom return values and in the Neptune trigger/hook APIs are unchanged.

Both classes are removed from the exemption list and the validate-operators-init check passes locally, as do the unit tests.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

@uranusjr

Copy link
Copy Markdown
Member

Since this is breaking either way, maybe it’s easier to rename the argument instead?

The operators template their cluster_id attribute while the constructor
exposes it as db_cluster_id, so the exemption-list validator flags the
mismatch. Renaming the argument keeps the templated attribute and its
template_fields entry stable and makes a wrong keyword fail loudly at
construction time.
@mitre88
mitre88 force-pushed the fix-neptune-template-fields branch from 16f3351 to 3325b40 Compare July 27, 2026 05:46
@mitre88 mitre88 changed the title Align Neptune operator template field with its db_cluster_id parameter Rename Neptune operator db_cluster_id argument to cluster_id Jul 27, 2026
@mitre88

mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Good point — reworked the PR to rename the argument instead: the constructor now takes cluster_id, the templated cluster_id attribute and template_fields stay exactly as on main, and a wrong keyword fails loudly with a TypeError. Updated the unit tests, the system test example, and added a breaking-change note to the provider changelog. PR title and description updated accordingly.


Drafted-by: Claude Code (Fable 5) (no human review before posting)

@vincbeck vincbeck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be treated as a bug fix, I dont think we need a major version bump for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants