Skip to content

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

@MaverickMei

Description

@MaverickMei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions