[jira] [Commented] (TINKERPOP-1561) gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5

2016-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15709216#comment-15709216
 ] 

ASF GitHub Bot commented on TINKERPOP-1561:
---

Github user asfgit closed the pull request at:

https://github.com/apache/tinkerpop/pull/505


> gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5
> ---
>
> Key: TINKERPOP-1561
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1561
> Project: TinkerPop
>  Issue Type: Bug
>  Components: language-variant
>Affects Versions: 3.2.3
> Environment: Python 3.5
>Reporter: David M. Brown
>
> Because {{long}} doesn't exist in Python 3, we created a simple wrapper that 
> inherits from {{int}} to fill the void. After the last changes to the 
> gremlin-python {{graphson}} module, this inheritance causes our longs to be 
> serialized as {{Int32}}. For example:
> {code}
> from gremlin_python.statics import long
> from gremlin_python.structure.io.graphson import GraphSONWriter
> writer = GraphSONWriter()
> writer.toDict(1)
> {'@type': 'g:Int32', '@value': 1}
> writer.toDict(long(1))
> {'@type': 'g:Int32', '@value': 1}
> {code}
> This should be an easy fix. As far as I can see there are two main approaches:
> 1. Combine the {{Int64IO}} and {{Int32IO}} classes and perform an instance 
> check for long in the {{dictify()}} method; or,
> 2. Implement a {{long}} type that doesn't inherit from {{int}}. Here we would 
> probably want to define a variety of methods so our {{long}} emulates 
> Python's numeric object.
> Does anyone have an opinion on a preferred approach? I would probably go with 
> the first approach, but either could work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1561) gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5

2016-11-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15709210#comment-15709210
 ] 

ASF GitHub Bot commented on TINKERPOP-1561:
---

Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/505
  
VOTE +1


> gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5
> ---
>
> Key: TINKERPOP-1561
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1561
> Project: TinkerPop
>  Issue Type: Bug
>  Components: language-variant
>Affects Versions: 3.2.3
> Environment: Python 3.5
>Reporter: David M. Brown
>
> Because {{long}} doesn't exist in Python 3, we created a simple wrapper that 
> inherits from {{int}} to fill the void. After the last changes to the 
> gremlin-python {{graphson}} module, this inheritance causes our longs to be 
> serialized as {{Int32}}. For example:
> {code}
> from gremlin_python.statics import long
> from gremlin_python.structure.io.graphson import GraphSONWriter
> writer = GraphSONWriter()
> writer.toDict(1)
> {'@type': 'g:Int32', '@value': 1}
> writer.toDict(long(1))
> {'@type': 'g:Int32', '@value': 1}
> {code}
> This should be an easy fix. As far as I can see there are two main approaches:
> 1. Combine the {{Int64IO}} and {{Int32IO}} classes and perform an instance 
> check for long in the {{dictify()}} method; or,
> 2. Implement a {{long}} type that doesn't inherit from {{int}}. Here we would 
> probably want to define a variety of methods so our {{long}} emulates 
> Python's numeric object.
> Does anyone have an opinion on a preferred approach? I would probably go with 
> the first approach, but either could work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1561) gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5

2016-11-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15702507#comment-15702507
 ] 

ASF GitHub Bot commented on TINKERPOP-1561:
---

Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/505
  
I have no way of checking Python 3.x, but note that everything is good for 
Python 2.x.

```
[INFO] 

[INFO] BUILD SUCCESS
[INFO] 

[INFO] Total time: 11:12 min
[INFO] Finished at: 2016-11-28T10:05:20-07:00
[INFO] Final Memory: 212M/1302M
[INFO] 

```

VOTE +1.


> gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5
> ---
>
> Key: TINKERPOP-1561
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1561
> Project: TinkerPop
>  Issue Type: Bug
>  Components: language-variant
>Affects Versions: 3.2.3
> Environment: Python 3.5
>Reporter: David M. Brown
>
> Because {{long}} doesn't exist in Python 3, we created a simple wrapper that 
> inherits from {{int}} to fill the void. After the last changes to the 
> gremlin-python {{graphson}} module, this inheritance causes our longs to be 
> serialized as {{Int32}}. For example:
> {code}
> from gremlin_python.statics import long
> from gremlin_python.structure.io.graphson import GraphSONWriter
> writer = GraphSONWriter()
> writer.toDict(1)
> {'@type': 'g:Int32', '@value': 1}
> writer.toDict(long(1))
> {'@type': 'g:Int32', '@value': 1}
> {code}
> This should be an easy fix. As far as I can see there are two main approaches:
> 1. Combine the {{Int64IO}} and {{Int32IO}} classes and perform an instance 
> check for long in the {{dictify()}} method; or,
> 2. Implement a {{long}} type that doesn't inherit from {{int}}. Here we would 
> probably want to define a variety of methods so our {{long}} emulates 
> Python's numeric object.
> Does anyone have an opinion on a preferred approach? I would probably go with 
> the first approach, but either could work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1561) gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5

2016-11-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15698417#comment-15698417
 ] 

ASF GitHub Bot commented on TINKERPOP-1561:
---

GitHub user davebshow opened a pull request:

https://github.com/apache/tinkerpop/pull/505

TINKERPOP-1561 gremiln-python GraphSONWriter doesn't properly serialize 
long in Python 3.5

https://issues.apache.org/jira/browse/TINKERPOP-1561

Added custom `dictify()` method to `Int32IO` that checks for long type. 
This ensures proper serialization of `long` when using Python 3. Originally in 
the Jira ticket I proposed a different approach, but after looking more closely 
this is the simplest approach. 

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1561

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/505.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #505


commit 8ab88820b263fa3d800fbf38bebf2a4232a01607
Author: davebshow 
Date:   2016-11-26T19:43:54Z

check for long type in Int32 serializer




> gremiln-python GraphSONWriter doesn't properly serialize long in Python 3.5
> ---
>
> Key: TINKERPOP-1561
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1561
> Project: TinkerPop
>  Issue Type: Bug
>  Components: language-variant
>Affects Versions: 3.2.3
> Environment: Python 3.5
>Reporter: David M. Brown
>
> Because {{long}} doesn't exist in Python 3, we created a simple wrapper that 
> inherits from {{int}} to fill the void. After the last changes to the 
> gremlin-python {{graphson}} module, this inheritance causes our longs to be 
> serialized as {{Int32}}. For example:
> {code}
> from gremlin_python.statics import long
> from gremlin_python.structure.io.graphson import GraphSONWriter
> writer = GraphSONWriter()
> writer.toDict(1)
> {'@type': 'g:Int32', '@value': 1}
> writer.toDict(long(1))
> {'@type': 'g:Int32', '@value': 1}
> {code}
> This should be an easy fix. As far as I can see there are two main approaches:
> 1. Combine the {{Int64IO}} and {{Int32IO}} classes and perform an instance 
> check for long in the {{dictify()}} method; or,
> 2. Implement a {{long}} type that doesn't inherit from {{int}}. Here we would 
> probably want to define a variety of methods so our {{long}} emulates 
> Python's numeric object.
> Does anyone have an opinion on a preferred approach? I would probably go with 
> the first approach, but either could work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)