`to_table` fails on sub-properties
Summary
The SELECT query allows to return sub-properties, for example SELECT MusicalInstrument.price FROM MusicalAnalysis
. The resulting object however is not converted properly to a DataFrame by the to_table
function.
Expected Behavior
The columns of the DataFrame should correspond to the property name chain, for example MusicalInstrument.Manufacturer.Location
.
Actual Behavior
Currently, to_table
just creates a column with the first level, like MusicalInstrument
. The content is the Entity's XML string representation.
Steps to Reproduce the Problem
Using the demo server:
data = db.execute_query("SELECT quality_factor, MusicalInstrument.price, MusicalInstrument.Manufacturer FROM RECORD MusicalAnalysis" )
table = to_table(data)
print(table)
Specifications
- Version: Current dev branch of pycaosdb and caosadvancedtools.
- Platform: Linux
Possible fixes
The to_table
could walk through all properties of the entities in the returned object. Possibly the XML parser needs to be improved for that.