vdms icon indicating copy to clipboard operation
vdms copied to clipboard

Properties not defined on some entities break a result set

Open mwahle opened this issue 6 years ago • 3 comments
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}],
[])

mwahle avatar Dec 10 '18 20:12 mwahle

Thanks Manuel, we really appreciate the minimal reproducible example, thanks for detailing it.

Will work on this ASAP.

luisremis avatar Dec 10 '18 20:12 luisremis

@cwlacewe did this ever get resolved? If not, its a reasonable ask.

keirafadams avatar Jul 23 '24 18:07 keirafadams

@cwlacewe did this ever get resolved? If not, its a reasonable ask.

@ifadams from my knowledge, this was not resolved

cwlacewe avatar Jul 24 '24 22:07 cwlacewe