[
https://issues.apache.org/jira/browse/TINKERPOP-1881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16347071#comment-16347071
]
stephen mallette edited comment on TINKERPOP-1881 at 1/31/18 4:11 PM:
----------------------------------------------------------------------
-What is the data type of "custom45"?-
never mind....didn't read the question right
was (Author: spmallette):
What is the data type of "custom45"?
> Gremlin-Python: id object does not appear to be serializable
> ------------------------------------------------------------
>
> Key: TINKERPOP-1881
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1881
> Project: TinkerPop
> Issue Type: Bug
> Components: python
> Affects Versions: 3.3.1
> Reporter: Taylor Riggan
> Priority: Blocker
>
> When attempting to add vertices and edges with custom IDs using the following
> traversal, Python returns an error stating that the returned object from the
> id built-in function is not serializable.
> Example traversal:
> {code:java}
> g.addV().property(id,"custom45").iterate()
> {code}
> Error / Stack trace:
> {code:java}
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py",
> line 57, in iterate
> try: self.nextTraverser()
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py",
> line 61, in nextTraverser
> self.traversal_strategies.apply_strategies(self)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py",
> line 352, in apply_strategies
> traversal_strategy.apply(traversal)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/remote_connection.py",
> line 143, in apply
> remote_traversal = self.remote_connection.submit(traversal.bytecode)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/driver_remote_connection.py",
> line 53, in submit
> result_set = self._client.submit(bytecode)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/client.py",
> line 104, in submit
> return self.submitAsync(message, bindings=bindings).result()
> File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 405, in result
> return self.__get_result()
> File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 357, in
> __get_result
> raise self._exception
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/connection.py",
> line 63, in cb
> f.result()
> File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 398, in result
> return self.__get_result()
> File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 357, in
> __get_result
> raise self._exception
> File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 55, in run
> result = self.fn(*self.args, **self.kwargs)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py",
> line 65, in write
> request_id, request_message)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/serializer.py",
> line 128, in serialize_message
> message = self.build_message(request_id, processor, op, args)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/serializer.py",
> line 138, in build_message
> return self.finalize_message(message, b"\x21", self.version)
> File
> "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/serializer.py",
> line 141, in finalize_message
> message = json.dumps(message)
> File "/usr/lib64/python3.6/json/__init__.py", line 231, in dumps
> return _default_encoder.encode(obj)
> File "/usr/lib64/python3.6/json/encoder.py", line 199, in encode
> chunks = self.iterencode(o, _one_shot=True)
> File "/usr/lib64/python3.6/json/encoder.py", line 257, in iterencode
> return _iterencode(o, 0)
> File "/usr/lib64/python3.6/json/encoder.py", line 180, in default
> o.__class__.__name__)
> TypeError: Object of type 'builtin_function_or_method' is not JSON
> serializable
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)