-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: make datacenter
argument optional when creating a primary ip
#363
base: main
Are you sure you want to change the base?
fix!: make datacenter
argument optional when creating a primary ip
#363
Conversation
Create a primary ips assigned to a resource without having to pass the datacenter argument.
This is a breaking change, but I'd argue it is a necessary bug fix. @apricote Should we release a v2, and try to pack a few breaking changes in addition to this one? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
=======================================
Coverage 92.86% 92.86%
=======================================
Files 65 65
Lines 2872 2873 +1
=======================================
+ Hits 2667 2668 +1
Misses 205 205 ☔ View full report in Codecov by Sentry. |
To be sure, this is breaking change for the reasons outlined in #223? Is it possible to just define the |
Sort of, adding the star in the argument list will help us to prevent this specific problem in the future indeed. But I am not sure if implementing #223 is a good idea right now, as it will break a LOT of functions.
Python does not allow having optional arguments before required arguments, we MUST move the required -client.primary_ips.create("ipv4", None, "my-ip", assignee_id=12345)
+client.primary_ips.create("ipv4", "my-ip", assignee_id=12345) -client.primary_ips.create("ipv4", datacenter, "my-ip")
+client.primary_ips.create("ipv4", "my-ip", datacenter) Using named arguments should be safe with the breaking change: client.primary_ips.create(type="ipv4", datacenter=None, name="my-ip", assignee_id=12345) |
Create a primary ips assigned to a resource without having to pass the datacenter argument.