Closed rosenbrockc closed 7 years ago
Good catch here...we still need to validate in the case of a long
type:
if isinstance(val, long):
return long(val)
return int(val)
I'd be happy to accept a PR.
To master or property_datatype_refactor
?
direct to the refactor branch.
goblin.Integer
uses the built-in pythonint
for validating whether a given value is integer (https://github.com/davebshow/goblin/blob/master/goblin/properties.py#L175). However, this causes problems with 64-bit integers. For example,list
andset
cardinality creates*VertexPropertyManager
instances that call validate on each argument they are given.In order to support correct GraphSON serialization to
Int64
,gremlin_python
creates along
type ingremlin_python.statics
. Developers should cast integers to that sub-class ofint
if they want them to be serialized correctly to the database. Sets of 64-bit integers, however, get cast back to the 32-bitint
because of the validator.I propose replacing the existing validate with:
where
long
isfrom gremlin_python.statics import long
. Happy to pull request for this again.