Skip to content

Error in my sample code #86

@Xls1994

Description

@Xls1994

Hi, I write a simple code like this:

client_stub =pydgraph.DgraphClientStub("spark-1:9082")
client =pydgraph.DgraphClient(client_stub)
txn =client.txn()
p={
    #'uid':'0x12',
    'name':'Tony11',
    'city':'Franch',
}
print p
try:
    assigned = txn.mutate(set_obj=p)
    txn.commit()
finally:
    txn.discard()

client_stub.close()

However I got a error with this code as follows:

Traceback (most recent call last):
  File "dgraphTest.py", line 12, in <module>
    assigned = txn.mutate(set_obj=p)
  File "D:\Program\Anaconda\lib\site-packages\pydgraph\txn.py", line 71, in muta
te
    return self.do_request(req, timeout=timeout, metadata=metadata, credentials=
credentials)
  File "D:\Program\Anaconda\lib\site-packages\pydgraph\txn.py", line 110, in do_
request
    self._common_except_mutate(query_error)
  File "D:\Program\Anaconda\lib\site-packages\pydgraph\txn.py", line 160, in _co
mmon_except_mutate
    raise error
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "Empty query"
        debug_error_string = "{"created":"@1568282122.945000000","description":"
Error received from peer ipv4:10.18.216.230:9082","file":"src/core/lib/surface/c
all.cc","file_line":1052,"grpc_message":"Empty query","grpc_status":2}"

the version of pydgraph is 2.0.2.
the version of Dgraph is v1.0.16
I could not understand what/s wrong with my code, please help me. Thanks!

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