-
Notifications
You must be signed in to change notification settings - Fork 4
Prevent imaginary/empty attributes being retrieved from Analysis #48
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
Conversation
thclark
left a comment
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.
I've just realised why I did this in the first place.
The purpose was to ensure that, once created, users couldn't monkey around with the actual objects, which have a protected UUID attribute.
That way we don't have somebody deciding to override the output_manifest with another Manifest object. Whilst that might not seem a big deal, it'd allow us to keep consistency throughout the process and report what manifest the results will end up in right at the start of the process.
-
I didn't call
super().getattr(self, f"_{name}") anywhere, which is whyanalysis.furry_purry_catwouldreturn Noneinstead of anAttributeError` -
This still needs a test that the
output_manifestis created when the twine has anoutput_manifeststrand, I think that hasn't been fixed yet
|
@thclark would you like the previous behaviour restored and a call to |
On the one hand we have the philosophy that we should make it as easy as possible for users to do things in sensible ways, but as hard as possible to do things which may have unintended consequences (like pulling the switcharoo on manifests attached to Analysis). On the other hand, we have our own development efficiency (we're still at an early stage mavericking through this, and if you find it to be easier to debug when the objects are directly attached then we can move through issues quicker) and the general zen of python I perhaps lean toward the latter but am torn (and am also suffering from the sunk cost fallacy, because I wrote the code in the first place). Feel free to decide the approach you favour, I'll support you 💯 |
|
I'm in favour of the latter too as I think the extra complexity may lead to inadvertent bugs. I'm also thinking that most users won't need to touch the analysis object or anything else if they're using the CLI - is this a correct assumption? Even if they do need/want to, I'm think that the user should be trusted not to mess around with the attributes of objects that have been produced for them via a black box, and if they do change them, it would be reasonable to expect there might be a problem |
thclark
left a comment
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.
Looks good to me!
| # Otherwise do nothing and rely on manifest having its path variable set already | ||
| return manifest | ||
| # Otherwise do nothing and rely on manifest having its path variable set already | ||
| return manifest |
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.
Aha!!
Summary
Prevents imaginary attributes being retrieved from
Analysis.Contents
Minor fixes and improvements