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

Dict: implement the __contains__ method #5328

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jan 25, 2022

Fixes #5326

This now allows to do the following:

'some_key' in Dict({'value'})

and is guaranteed to return a boolean, instead of raising a KeyError
if the key doesn't exist, which was the previous behavior.

This now allows to do the following:

    'some_key' in Dict({'value'})

and is guaranteed to return a boolean, instead of raising a `KeyError`
if the key doesn't exist, which was the previous behavior.
@sphuber
Copy link
Contributor Author

sphuber commented Jan 25, 2022

@louisponet

@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #5328 (81f9e0e) into develop (fe1acf9) will decrease coverage by 0.03%.
The diff coverage is 79.60%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5328      +/-   ##
===========================================
- Coverage    82.13%   82.11%   -0.02%     
===========================================
  Files          533      533              
  Lines        38478    38427      -51     
===========================================
- Hits         31601    31549      -52     
- Misses        6877     6878       +1     
Flag Coverage Δ
django 77.18% <79.60%> (-0.03%) ⬇️
sqlalchemy 76.48% <78.24%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
aiida/cmdline/commands/cmd_setup.py 56.87% <0.00%> (+5.99%) ⬆️
aiida/cmdline/commands/cmd_status.py 84.77% <ø> (ø)
aiida/cmdline/params/options/commands/setup.py 54.55% <0.00%> (-2.29%) ⬇️
aiida/cmdline/params/types/profile.py 64.45% <0.00%> (ø)
aiida/manage/configuration/__init__.py 83.73% <50.00%> (+0.13%) ⬆️
aiida/manage/configuration/config.py 89.48% <71.43%> (+0.30%) ⬆️
aiida/manage/external/postgres.py 63.10% <75.00%> (+0.14%) ⬆️
aiida/backends/utils.py 93.34% <83.34%> (-6.66%) ⬇️
aiida/manage/configuration/profile.py 89.60% <84.91%> (-6.67%) ⬇️
...iida/manage/configuration/migrations/migrations.py 93.89% <90.91%> (-0.35%) ⬇️
... and 10 more

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 3af6f6a...81f9e0e. Read the comment docs.

@sphuber sphuber requested a review from mbercx January 26, 2022 07:43
Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

All good, thanks @sphuber!

EDIT: Well, once you can appease the codecov Gods. 😅

@sphuber sphuber merged commit af3bb3d into aiidateam:develop Jan 26, 2022
@sphuber sphuber deleted the fix/5326/dict-contains branch January 26, 2022 08:50
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.

key in Dict errors when key not in Dict
2 participants