-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add uuid property to Parameter #11647
Conversation
This change adds a public, read-only uuid property to Parameter which can be used in advanced use cases for getting the uuid value to pass to the Parameter constructor.
One or more of the the following people are requested to review this:
|
I tried building the docs locally but I didn't see my release note in the notes. Is there a trick to it? I am never sure if I have written valid sphinx restructured text without compiling it. A couple questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this LGTM, it makes sense to enable a read only attribute for the uuid since it's already a documented part of the constructor. Just one small inline comment/question about the docstring.
A test wouldn't hurt but this is also so simple I'm not going to say it's required.
This is a good idea, and would actually take care of the test coverage for you so you definitely don't need a bespoke test for this attribute. |
I tagged this for 1.1.0 because it is technically a new feature past the proposal deadline for 1.0.0, but I think it's simple enough to grant an exception to the freeze deadline, but I'll wait for someone else to confirm before re-tagging for 1.0.0 |
Pull Request Test Coverage Report for Build 7670104958
💛 - Coveralls |
I pushed a commit that does this. The one thing about it is that other places still refer to
It is not urgent since |
I'm ok on granting a freeze exception to a getter that I think was just an oversight in the interface when the UUID was added in #2947. Copying in an above comment, because I think it might be in a thread GitHub had already collapsed:
|
I didn't see a basic test of |
Huh, me too, although I suppose that once we've made a UUID, it's wasting time to compare a string as well. |
Technically, though, Parameter is violating the requirement from the Python data model (which often seems to bite me): "The only required property is that objects which compare equal have the same hash value." Likely, either the name should be included in the hash or the hash key should be just the uuid. |
Oh, in that case it's a bug yeah thanks - I guess we should add the name to the equality check, since the documentation around the class says they need to have the same name to be equal. |
Co-authored-by: Matthew Treinish <[email protected]>
3348f65
to
1710468
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change adds a public, read-only uuid property to Parameter which can be used in advanced use cases for getting the uuid value to pass to the Parameter constructor.