Skip to content
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 (v1.4.x) #4616

Merged

Conversation

ramirezfranciscof
Copy link
Member

@ramirezfranciscof ramirezfranciscof commented Dec 4, 2020

Fixes #4454

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.

@ramirezfranciscof ramirezfranciscof changed the title Fix wrong raise from dict nodes Bugfix 1.4.x - Fix wrong raise from dict nodes Dec 4, 2020
@ramirezfranciscof ramirezfranciscof changed the title Bugfix 1.4.x - Fix wrong raise from dict nodes Fix wrong raise from dict nodes (v1.4.x) Dec 4, 2020
@codecov
Copy link

codecov bot commented Dec 4, 2020

Codecov Report

Merging #4616 (d489fee) into support/1.4.x (c063609) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                Coverage Diff                @@
##           support/1.4.x    #4616      +/-   ##
=================================================
+ Coverage          79.22%   79.22%   +0.01%     
=================================================
  Files                475      475              
  Lines              34828    34831       +3     
=================================================
+ Hits               27589    27593       +4     
+ Misses              7239     7238       -1     
Flag Coverage Δ
django 73.07% <100.00%> (+0.01%) ⬆️
sqlalchemy 72.30% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/orm/nodes/data/dict.py 86.05% <100.00%> (+1.05%) ⬆️
aiida/engine/daemon/runner.py 82.76% <0.00%> (+3.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c063609...d489fee. Read the comment docs.

@ramirezfranciscof
Copy link
Member Author

@sphuber this can be merged in without the CI fix right?

@sphuber
Copy link
Contributor

sphuber commented Dec 4, 2020

@sphuber this can be merged in without the CI fix right?

Prefer not to. I am about to merge the fix into release/1.5.1 so then you can rebase it and then I will merge it. That should then also be the last item for v1.5.1 so we could do the release. Could you prepare and do it?

@ramirezfranciscof
Copy link
Member Author

So, I already rebased the one that goes into release/1.5.1 (here)but this is the one that goes into 1.4.4, I don't need to do any rebasing or anything for this right?

@sphuber
Copy link
Contributor

sphuber commented Dec 4, 2020

So, I already rebased the one that goes into release/1.5.1 (here)but this is the one that goes into 1.4.4, I don't need to do any rebasing or anything for this right?

Ah damn, didn't realize this is another copy of the same PR. Well I think these tests would have failed as well and will start to fail once we merge it in support/1.4.x so we should actually put the same fix on that branch as well. I will do it now.

@ramirezfranciscof
Copy link
Member Author

@sphuber Python 3.5 seems to have a problem with numpy

ERROR: No matching distribution found for numpy==1.19.4
Error: Process completed with exit code 1.

I'm not sure if maybe we need to copy this fix to python 3.5 as well??

    # Work-around issue caused by pymatgen's setup process, which will install the latest
    # numpy version (including release candidates) regardless of our actual specification:
    - name: Install numpy [py36]
      if: matrix.python-version == 3.6
      run: |
        pip install `grep 'numpy==' requirements/requirements-py-${{ matrix.python-version }}.txt`

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.
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go! Thanks

@sphuber sphuber merged commit 87d7a60 into aiidateam:support/1.4.x Dec 4, 2020
@sphuber sphuber deleted the support_1.4/fix_dict branch December 4, 2020 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants