Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python客户端:result = self.session_pool.execute_parameter(query, params) 参数问题 #337

Open
jiechencsll opened this issue Apr 23, 2024 · 2 comments

Comments

@jiechencsll
Copy link

jiechencsll commented Apr 23, 2024

General Question
query_ngql='''
MATCH (v) where v.meta.dataset_id=='$name' and v.meta.p_vid is null return v limit 1
'''
data1={"name":"dsdsdsd"}
result = session_pool.execute_parameter(query_ngql, data1)
执行报错
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/SessionPool.py", line 163, in execute_parameter
resp = session.execute_parameter(stmt, params)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/Session.py", line 42, in execute_parameter
resp = self._connection.execute_parameter(self._session_id, stmt, params)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/Connection.py", line 148, in execute_parameter
resp = self._connection.executeWithParameter(session_id, stmt, params)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/graph/GraphService.py", line 1651, in executeWithParameter
self.send_executeWithParameter(sessionId, stmt, parameterMap)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/graph/GraphService.py", line 1660, in send_executeWithParameter
args.write(self._oprot)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/graph/GraphService.py", line 754, in write
viter64.write(oprot)
AttributeError: 'str' object has no attribute 'write'
Exception ignored in: <function Session.del at 0x7fe400407520>
Traceback (most recent call last):
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/Session.py", line 273, in del
self.release()
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/Session.py", line 235, in release
self._connection.signout(self._session_id)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/gclient/net/Connection.py", line 205, in signout
self._connection.signout(session_id)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/graph/GraphService.py", line 1603, in signout
self.send_signout(sessionId)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/graph/GraphService.py", line 1606, in send_signout
self._oprot.writeMessageBegin('signout', TMessageType.CALL, self._seqid)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/fbthrift/protocol/THeaderProtocol.py", line 89, in writeMessageBegin
self.__proto.writeMessageBegin(name, type, seqid)
File "/usr/local/anaconda3/envs/langchain-cc/lib/python3.10/site-packages/nebula3/fbthrift/protocol/TCompactProtocol.py", line 151, in writeMessageBegin
assert self.state == CLEAR
AssertionError:

请问paramter这个参数应该怎么传

@wey-gu
Copy link
Contributor

wey-gu commented May 11, 2024

please refer to https://github.com/vesoft-inc/nebula-python/blob/master/tests/test_parameter.py

I'll prepare docs later, sorry for this :)

@wey-gu
Copy link
Contributor

wey-gu commented May 27, 2024

#349 should make this ux much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants