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

Querybuilder init now accepts entity_type = '' #4299

Merged
merged 2 commits into from
Aug 13, 2020

Conversation

ramirezfranciscof
Copy link
Member

There was a bug when using the queryhelp of a previously defined
QueryBuilder which was appended a single query for the generic "Node"
class as a template in the initialization for a new query.

The underlying problem was that the append method was doing the wrong
checks to detect missing cls/entity_type.

Also added a test for this new specific case.

Fixes #4248

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #4299 into develop will increase coverage by 6.39%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4299      +/-   ##
===========================================
+ Coverage    72.83%   79.21%   +6.39%     
===========================================
  Files          468      468              
  Lines        34559    34559              
===========================================
+ Hits         25166    27374    +2208     
+ Misses        9393     7185    -2208     
Flag Coverage Δ
#django 72.82% <100.00%> (-<0.01%) ⬇️
#sqlalchemy 72.01% <100.00%> (?)

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

Impacted Files Coverage Δ
aiida/orm/querybuilder.py 80.10% <100.00%> (ø)
aiida/engine/daemon/client.py 72.42% <0.00%> (-1.14%) ⬇️
aiida/transports/plugins/local.py 81.29% <0.00%> (+0.26%) ⬆️
aiida/backends/testbase.py 93.40% <0.00%> (+1.89%) ⬆️
aiida/common/hashing.py 95.10% <0.00%> (+1.97%) ⬆️
aiida/manage/manager.py 95.34% <0.00%> (+2.00%) ⬆️
aiida/manage/tests/__init__.py 88.54% <0.00%> (+2.30%) ⬆️
aiida/backends/manager.py 72.42% <0.00%> (+5.75%) ⬆️
aiida/cmdline/params/types/strings.py 78.85% <0.00%> (+5.77%) ⬆️
aiida/cmdline/params/types/profile.py 66.67% <0.00%> (+8.34%) ⬆️
... and 79 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 5786921...68b74dc. Read the comment docs.

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.

Thanks @ramirezfranciscof , some minor requests

aiida/orm/querybuilder.py Outdated Show resolved Hide resolved
aiida/orm/querybuilder.py Outdated Show resolved Hide resolved
aiida/orm/querybuilder.py Outdated Show resolved Hide resolved
aiida/orm/querybuilder.py Outdated Show resolved Hide resolved
aiida/orm/querybuilder.py Outdated Show resolved Hide resolved
tests/orm/test_querybuilder.py Outdated Show resolved Hide resolved
tests/orm/test_querybuilder.py Outdated Show resolved Hide resolved
There was a bug when using the queryhelp of a previously defined
QueryBuilder which was appended a single query for the generic "Node"
class as a template in the initialization for a new query.

The underlying problem was that the append method was doing the wrong
checks to detect missing cls/entity_type.

Also modified a test to check for this specific case.
@ramirezfranciscof
Copy link
Member Author

@sphuber very sorry for the commented leftovers, I had to take a break between making it work and preparing the PR and in the middle I forgot to take those out. Now it should be ready, I will re-request your final review once all the CI tests pass.

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.

All good, thanks @ramirezfranciscof

@sphuber sphuber merged commit 27171d0 into aiidateam:develop Aug 13, 2020
@sphuber sphuber deleted the issue4248 branch August 13, 2020 10:53
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.

Issue with the queryhelp when appending a Node
2 participants