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?

@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

@o-nikolas o-nikolas 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.

To me it feels more correct to change the template field names, not the argument itself in the constructor. But it I wont die on that hill if everyone else things otherwise

@mitre88
mitre88 force-pushed the fix-neptune-template-fields branch from 3325b40 to 8d66934 Compare July 30, 2026 02:44
@mitre88
mitre88 force-pushed the fix-neptune-template-fields branch 2 times, most recently from 0b8d7b2 to 3f4f1e8 Compare August 1, 2026 02:23
@eladkal eladkal removed the backport-to-v3-3-test Backport to v3-3-test label Aug 3, 2026
@eladkal

eladkal commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

To me it feels more correct to change the template field names, not the argument itself in the constructor. But it I wont die on that hill if everyone else things otherwise

I believe this is more AWS decision how you want to play this. Probably the merge click is waiting for the team to decide if you are happy with it as is or would you like to ask author to change approach.

Rebased onto current main after apache#70485 removed the SageMaker exemptions.
Constructor args now match the templated cluster_id attribute; Neptune
provision-check exemptions are dropped accordingly.
@mitre88
mitre88 force-pushed the fix-neptune-template-fields branch from 3f4f1e8 to bc34de5 Compare August 9, 2026 03:54
@vincbeck

Copy link
Copy Markdown
Contributor

To me it feels more correct to change the template field names, not the argument itself in the constructor. But it I wont die on that hill if everyone else things otherwise

I agree with Niko, can we change the template field instead?

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.

5 participants