-
Notifications
You must be signed in to change notification settings - Fork 192
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 wrong raise from dict nodes #4577
Fix wrong raise from dict nodes #4577
Conversation
26718ef
to
dd8aaeb
Compare
Codecov Report
@@ Coverage Diff @@
## release/1.5.1 #4577 +/- ##
=================================================
+ Coverage 79.50% 79.51% +0.01%
=================================================
Files 482 482
Lines 35320 35323 +3
=================================================
+ Hits 28078 28082 +4
+ Misses 7242 7241 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Changes look fine to me, I am just wondering about backwards compatibility. Some code out there may rely on this (maybe incorrectly) raising an |
Also paging @yakutovicha who run into this problem originally and actually had to code around it. |
Hm... that's a tricky one. In that particular case it wouldn't be too bad since an exception is raised anyhow but it's possible that other plugins catch the exception and do something else. I don't have a strong opinion on whether to wait until 2.0 with this or not. |
I fear here we have to define a mixed exception that inherits from both? Or we accept that forever in the future the exception raised there is a mixed exception (BTW, the aiida-exciting plugin is still at version 0.x so I wouldn't worry about it, but it's true that others might be catching it. |
I think people, who relied on the "incorrect" behaviour should have put a catch for both: |
This behaviour was introduced in version |
Not sure, |
I mean, I think this fix should be simple enough that I can do a fix in |
Just create a
No. Since we simply added a bug in v1.4 and we are now fixing it in a patch version of the minor branch, backwards compatibility doesn't really apply here. |
@ramirezfranciscof can you rebase this on |
dd8aaeb
to
3a465c4
Compare
@sphuber hey, I'm not sure what is happening here. The two tests for 3.6 are failing during installation and django 3.8 (but not sqlalchemy 3.8?) is failing due to an error that doesn't seem to be related to dicts. |
See this issue. I have already opened PR #4615 to fix it. Just needs to be approved. That explains the failures under Python 3.6. The Python 3.8 Django failure is just a fluke, just look at the logs. |
3a465c4
to
87b8f7f
Compare
@sphuber this one should be ready to merge. |
397de26
to
8058a97
Compare
c660408
to
382e9d1
Compare
When accessing an attribute as a dict (`dictnode['key']`), the error raised was an AttributeError instead of a KeyError, which is rather unusual. This has been fixed and a test that checks the correct error raise has been added. Cherry-pick: 87d7a60
382e9d1
to
a5717e8
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 am getting a déjà vu...
When accessing an attribute as a dict (
dictnode['key']
), the error raised was an AttributeError instead of a KeyError, which is rather unusual. This has been fixed and a test that checks the correct error raise has been added.Fixes #4454