-
Notifications
You must be signed in to change notification settings - Fork 210
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
can't find codes when looking for AbstractCode
#6687
Comments
- Add additional guards for missing code setup input - Disable quick setup button if missing any requisites - Apply uniqueness to missing template variables warning - Make `ResourceSetupBaseWidget` "public" - Fix code full label uniqueness check Note that the fix in the query that looks for existing codes is a hack due to a potential bug in aiida-core. See aiidateam/aiida-core#6687.
Hey, I’m interested in contributing to this issue. I see that orm.QueryBuilder().append(orm.AbstractCode) isn’t returning results due to the node_type mismatch. Would updating the node_type filter in QueryBuilder to match data.core.code.% be a suitable fix, or is there a reason it was originally set to data.code.abstract.%? |
CC @sphuber in case he remembers the design decisions behind AbstractCode. |
The problem here is that the hierarchy of ORM classes are defined differently in Python compared to how it is represented in the database (which is what the So for all of this to work, the With that all out of the way, we now come to the specific problem of the OP. The Line 104 in f4c55f5
This has presumably not yet given rise to any problems because it is never actually instantiated, only its subclasses. But I am a bit suprised as to how the query string is generated then when calling QueryBuilder().append(AbstractCode) .
Anyway, I think the solution should be the following:
I think querying for |
Describe the bug
orm.QueryBuilder().append(orm.AbstractCode)
will not find any codes, as the resultant query has{'node_type': {'like': 'data.code.abstract.%'}
, whereas codes carry an entry point ofdata.core.code.%
.Steps to reproduce
Try finding any code with
orm.QueryBuilder().append(orm.AbstractCode)
. Count should always come up null.Expected behavior
Successfully find codes.
Your environment
Additional context
orm.QueryBuilder().append(orm.Code)
works, yielding{'node_type': {'like': 'data.core.code.%'}
. But then you're using the deprecatedorm.Code
.The text was updated successfully, but these errors were encountered: