IntelLabs / IntelLabs/vdms

Properties not defined on some entities break a result set

Open
#56 3 comments 1 reaction 0 assignees View on GitHub
Bug Discussion Needed Priority: Backlog
Dominant language
C++
Stars
93
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Using search criteria to search for entities where one of them does not have the property we search for gives an error message:
```
db.query([{'AddEntity': {'class': 'Test', 'properties': {'x': 1}}}])
Out[4]: ([{'AddEntity': {'info': '', 'status': 0}}], [])

db.query([{'AddEntity': {'class': 'Test', 'properties': {'x': 2}}}])
Out[5]: ([{'AddEntity': {'info': '', 'status': 0}}], [])

db.query([{'AddEntity': {'class': 'Test'}}])
Out[6]: ([{'AddEntity': {'info': '', 'status': 0}}], [])

db.query([{"FindEntity": {'class': 'Test', 'constraints': {'x': ['==', 1]}}}])
Out[7]:
([{'FindEntity': {'info': 'Unknown operation type for query\n',
'status': -1}}],
[])
```
Simply listing them does work:
```
db.query([{"FindEntity": {'class': 'Test', 'results': {'list': ['x']}}}])
Out[12]:
([{'FindEntity': {'entities': [{'x': 'Missing property'}, {'x': 2}, {'x': 1}],
'returned': 3,
'status': 0}}],
[])
```
but only if the results are not sorted:
```
db.query([{"FindEntity": {'class': 'Test', 'results': {'list': ['x'], 'sort': 'x'}}}])
Out[14]:
([{'FailedCommand': 'Transaction',
'info': 'Failed PMGDTransaction',
'status': -1}],
[])
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.