[jira] [Commented] (THRIFT-2642) Recursive structs don't work in python

2017-05-12 Thread Igor Rogozhin (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16008348#comment-16008348
 ] 

Igor Rogozhin commented on THRIFT-2642:
---

Actualy my team switched to java, but if you need help you can contact with me.
Dont think, that i totaly forget python for 6mo

> Recursive structs don't work in python
> --
>
> Key: THRIFT-2642
> URL: https://issues.apache.org/jira/browse/THRIFT-2642
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler, Python - Library
>Affects Versions: 0.9.2
>Reporter: Igor Kostenko
>
> Recursive structs in 0.9.2 work fine in c++ & c#, but not in python, because 
> generated code trying to use objects which not constructed yet.
> Struct:
> {code}
> struct Recursive {
> 1: list Children
> }
> {code}
> Python code:
> {code}
> class Recursive:
>   thrift_spec = (
> None, # 0
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
>   )
> {code}
> Error message:
> {code}
> Traceback (most recent call last):
>   File "ttypes.py", line 20, in 
> class Recursive:
>   File "ttypes.py", line 28, in Recursive
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
> NameError: name 'Recursive' is not defined
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Comment Edited] (THRIFT-2642) Recursive structs don't work in python

2016-07-22 Thread Igor Rogozhin (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15387504#comment-15387504
 ] 

Igor Rogozhin edited comment on THRIFT-2642 at 7/22/16 1:41 PM:


Hello from 2016.
We still have this problem.

I am using Julien's solution, but this kinda weird.
For full automation it required bash script, that's change this errors.
Maybe someone figure out how we can do it better?

EDIT:
Do we need "Recursive.thrift_spec"?
This kinda werid. I remove this on my project (and also fix following code for 
checking is None). 


was (Author: mytalala):
Hello from 2016.
We still have this problem.

I am using Julien's solution, but this kinda weird.
For full automation it required bash script, that's change this errors.
Maybe someone figure out how we can do it bett

> Recursive structs don't work in python
> --
>
> Key: THRIFT-2642
> URL: https://issues.apache.org/jira/browse/THRIFT-2642
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler, Python - Library
>Affects Versions: 0.9.2
>Reporter: Igor Kostenko
>
> Recursive structs in 0.9.2 work fine in c++ & c#, but not in python, because 
> generated code trying to use objects which not constructed yet.
> Struct:
> {code}
> struct Recursive {
> 1: list Children
> }
> {code}
> Python code:
> {code}
> class Recursive:
>   thrift_spec = (
> None, # 0
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
>   )
> {code}
> Error message:
> {code}
> Traceback (most recent call last):
>   File "ttypes.py", line 20, in 
> class Recursive:
>   File "ttypes.py", line 28, in Recursive
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
> NameError: name 'Recursive' is not defined
> {code}



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


[jira] [Commented] (THRIFT-2642) Recursive structs don't work in python

2016-07-21 Thread Igor Rogozhin (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15387504#comment-15387504
 ] 

Igor Rogozhin commented on THRIFT-2642:
---

Hello from 2016.
We still have this problem.

I am using Julien's solution, but this kinda weird.
For full automation it required bash script, that's change this errors.
Maybe someone figure out how we can do it bett

> Recursive structs don't work in python
> --
>
> Key: THRIFT-2642
> URL: https://issues.apache.org/jira/browse/THRIFT-2642
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler, Python - Library
>Affects Versions: 0.9.2
>Reporter: Igor Kostenko
>
> Recursive structs in 0.9.2 work fine in c++ & c#, but not in python, because 
> generated code trying to use objects which not constructed yet.
> Struct:
> {code}
> struct Recursive {
> 1: list Children
> }
> {code}
> Python code:
> {code}
> class Recursive:
>   thrift_spec = (
> None, # 0
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
>   )
> {code}
> Error message:
> {code}
> Traceback (most recent call last):
>   File "ttypes.py", line 20, in 
> class Recursive:
>   File "ttypes.py", line 28, in Recursive
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
> Recursive.thrift_spec)), None, ), # 1
> NameError: name 'Recursive' is not defined
> {code}



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