vdms
vdms copied to clipboard
Properties not defined on some entities break a result set
trafficstars
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}],
[])
Thanks Manuel, we really appreciate the minimal reproducible example, thanks for detailing it.
Will work on this ASAP.
@cwlacewe did this ever get resolved? If not, its a reasonable ask.
@cwlacewe did this ever get resolved? If not, its a reasonable ask.
@ifadams from my knowledge, this was not resolved