Skip to content

QueryBuilder can't find codes when looking for AbstractCode #6687

@edan-bainglass

Description

@edan-bainglass

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 of data.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

  • Linux (aiidalab/full-stack image)
  • Python 3.9.13
  • aiida-core v2.6.3

Additional context

orm.QueryBuilder().append(orm.Code) works, yielding {'node_type': {'like': 'data.core.code.%'}. But then you're using the deprecated orm.Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that should be relatively easy to fix also for beginning contributorstype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions