-
Notifications
You must be signed in to change notification settings - Fork 94
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 platform selection bug. #4975
Fix platform selection bug. #4975
Conversation
OrderedDictWithDefaults.__getiter__ will get the default, if it exists. OrderedDictWithDefaults.get does not get the default and was causing the platform selection to fail quietly and select localhost.
a8fa8b6
to
e0178f1
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.
I have checked this out and verified that it performs as expected. Checked tests also pass locally. Thanks @wxtim.
Why was |
Answer: because we don't want to mess up anything that already relies on the current behaviour. Note that >>> a = OrderedDictWithDefaults()
>>> a.defaults_ = OrderedDictWithDefaults([('job', OrderedDictWithDefaults([('batch sys', 'pbs')]))])
>>> a.get('job', {})
{} doesn't work, but this does: >>> a['job'].get('batch sys', None)
'pbs' because at that point you're accessing the primary dict of an OrderedDictWithDefaults as opposed to its defaults |
OrderedDictWithDefaults.__getitem__
will get the default, if it exists.OrderedDictWithDefaults.get
does not get the default and was causingthe platform selection to fail quietly and select localhost.
This change closes #4979
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.