orientechnologies / orientdb-docs

Repository of the entire OrientDB documentation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python API (Pyorient) a BUG in client.command docs

MaverickMei opened this issue · comments

official docs example:
...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"('device_id', 'read_time', 'read') "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...
but I test it in Python3.7 Pycharm run with Python console, I find ('device_id', 'read_time', 'read') will return error. Only if remove ‘ ’ it will have proper execution.

correct:

...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"(device_id, read_time, read) "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...

So maybe the example is wrong.