orientechnologies / pyorient

OrientDB driver for Python that uses the binary protocol.
Apache License 2.0
119 stars 38 forks source link

Messy oRecordData when a location and in()/out() is in projection of a query #18

Open aemitos opened 8 years ago

aemitos commented 8 years ago

Hi guys First, great job with pyorient. Congratulations. When I query in the console.sh, I got this:

select @rid,location,in(),out() from Entity       

+----+-----+-----------------------+-------+-------+
|#   |rid  |location               |in     |out    |
+----+-----+-----------------------+-------+-------+
|0   |#13:0|OPoint{coordinates:[2]}|[]     |[#14:0]|
|1   |#13:1|OPoint{coordinates:[2]}|[]     |[]     |
|2   |#14:0|OPoint{coordinates:[2]}|[#13:0]|[]     |
+----+-----+-----------------------+-------+-------+

3 item(s) found. Query executed in 0.006 sec(s).

So, everything ok. But, when I query in the pyorient I got this:

d = c.client.command('select location,in() as in,out() as out from Entity')
>>> for i in d:
...     print(i.oRecordData)
... 
{'location': {'o_class': 'OPoint', '[],out': [<pyorient.otypes.OrientRecordLink object at 0x107bd3a58>], 'coordinates': '[-22.8934087d,-47.0885695d]),in'}}
{'location': {'o_class': 'OPoint', '[],out': [], 'coordinates': '[-22.999385d,-47.108123d]),in'}}
{'location': {'[#13': 0, 'o_class': 'OPoint', '],out': [], 'coordinates': '[-15.784493d,-47.870311d]),in'}}
>>> 

Take a look at out, it came inside of location field. Am I doing something wrong or is it a bug? Thanks in advance Regards André