[jira] [Resolved] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-21 Thread Manasi Vartak (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manasi Vartak resolved THRIFT-4089.
---
Resolution: Information Provided

> Several issues with generated Python code: TFrozenDict, _fast_encode
> 
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler
>Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
>Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift 
> tutorial from https://thrift.apache.org/tutorial/py will also repro erros), 
> errors are thrown while running the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/SharedService.py", line 9, in 
> from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
> TApplicationException 
> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error 
> disappears on removing TFrozenDict from the generated files (it is not used 
> anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the 
> above fix), I get the following error:
>  File "PythonClient.py", line 51, in main
> client.ping()
>   File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
>   File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
>   File "gen-py/tutorial/Calculator.py", line 297, in write
> if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client 
> un-usable. Is this a known issue? And how do you recommend working around it?



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


[jira] [Commented] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-21 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4089:
---

That was indeed the issue, thank you!

> Several issues with generated Python code: TFrozenDict, _fast_encode
> 
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler
>Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
>Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift 
> tutorial from https://thrift.apache.org/tutorial/py will also repro erros), 
> errors are thrown while running the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/SharedService.py", line 9, in 
> from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
> TApplicationException 
> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error 
> disappears on removing TFrozenDict from the generated files (it is not used 
> anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the 
> above fix), I get the following error:
>  File "PythonClient.py", line 51, in main
> client.ping()
>   File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
>   File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
>   File "gen-py/tutorial/Calculator.py", line 297, in write
> if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client 
> un-usable. Is this a known issue? And how do you recommend working around it?



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


[jira] [Commented] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-14 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4089:
---

Got it. Let me check on that.

> Several issues with generated Python code: TFrozenDict, _fast_encode
> 
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler
>Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
>Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift 
> tutorial from https://thrift.apache.org/tutorial/py will also repro erros), 
> errors are thrown while running the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/SharedService.py", line 9, in 
> from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
> TApplicationException 
> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error 
> disappears on removing TFrozenDict from the generated files (it is not used 
> anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the 
> above fix), I get the following error:
>  File "PythonClient.py", line 51, in main
> client.ping()
>   File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
>   File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
>   File "gen-py/tutorial/Calculator.py", line 297, in write
> if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client 
> un-usable. Is this a known issue? And how do you recommend working around it?



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


[jira] [Commented] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-14 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4089:
---

Are you referring to the Python library? I tested with Python 3.5 as well, same 
issue.

> Several issues with generated Python code: TFrozenDict, _fast_encode
> 
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
>  Issue Type: Bug
>Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
>Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift 
> tutorial from https://thrift.apache.org/tutorial/py will also repro erros), 
> errors are thrown while running the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/SharedService.py", line 9, in 
> from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
> TApplicationException 
> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error 
> disappears on removing TFrozenDict from the generated files (it is not used 
> anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the 
> above fix), I get the following error:
>  File "PythonClient.py", line 51, in main
> client.ping()
>   File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
>   File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
>   File "gen-py/tutorial/Calculator.py", line 297, in write
> if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client 
> un-usable. Is this a known issue? And how do you recommend working around it?



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


[jira] [Updated] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-14 Thread Manasi Vartak (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manasi Vartak updated THRIFT-4089:
--
Environment: Python 2.7, 3.5. OS-X  (was: Python 2.7. OS-X)

> Several issues with generated Python code: TFrozenDict, _fast_encode
> 
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
>  Issue Type: Bug
>Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
>Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift 
> tutorial from https://thrift.apache.org/tutorial/py will also repro erros), 
> errors are thrown while running the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/SharedService.py", line 9, in 
> from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
> TApplicationException 
> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error 
> disappears on removing TFrozenDict from the generated files (it is not used 
> anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the 
> above fix), I get the following error:
>  File "PythonClient.py", line 51, in main
> client.ping()
>   File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
>   File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
>   File "gen-py/tutorial/Calculator.py", line 297, in write
> if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client 
> un-usable. Is this a known issue? And how do you recommend working around it?



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


[jira] [Created] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode

2017-02-13 Thread Manasi Vartak (JIRA)
Manasi Vartak created THRIFT-4089:
-

 Summary: Several issues with generated Python code: TFrozenDict, 
_fast_encode
 Key: THRIFT-4089
 URL: https://issues.apache.org/jira/browse/THRIFT-4089
 Project: Thrift
  Issue Type: Bug
Affects Versions: 0.10.0
 Environment: Python 2.7. OS-X
Reporter: Manasi Vartak


When you generate Python sources for a simple thrift file (e.g. Thrift tutorial 
from https://thrift.apache.org/tutorial/py will also repro erros), errors are 
thrown while running the PythonServer and PythonClient.

1.  When running the vanilla PythonServer, I get the following error:

File "gen-py/shared/SharedService.py", line 9, in 
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, 
TApplicationException 
ImportError: cannot import name TFrozenDict

I see this error consistently for all generated thrift files. The error 
disappears on removing TFrozenDict from the generated files (it is not used 
anywhere in the file).

2. When running the vanilla PythonClient (the server is now running after the 
above fix), I get the following error:

 File "PythonClient.py", line 51, in main
client.ping()
  File "gen-py/tutorial/Calculator.py", line 73, in ping
self.send_ping()
  File "gen-py/tutorial/Calculator.py", line 79, in send_ping
args.write(self._oprot)
  File "gen-py/tutorial/Calculator.py", line 297, in write
if oprot._fast_encode is not None and self.thrift_spec is not None:
AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'

I am not sure why this error is being thrown/what can be done to fix it.

These two errors, and mainly the latter one, are rendering the Server/Client 
un-usable. Is this a known issue? And how do you recommend working around it?




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


[jira] [Resolved] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-13 Thread Manasi Vartak (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manasi Vartak resolved THRIFT-4083.
---
Resolution: Information Provided

> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>Priority: Minor
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Commented] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-11 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4083:
---

That worked out. I was adding the thrift-plugin as a dependency as suggested 
above which was causing the issue (I don't believe that you can alter the java 
version of a dependency). Adding it as a plugin, along with the correct java 
version fixed it. 

Thanks for the help!

> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>Priority: Minor
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Commented] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-11 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4083:
---

Couple of things point me to a Java issue but maybe there's something I'm 
missing:
1. If I just add the dependency for thrift-maven-plugin and not specify any 
source/target version in the pom, the default Java version, 1.5, is used and 
the compiler throws various errors such as: "lambda expressions are not 
supported in -source 1.5"
2. If I add the dependency and specify the source/target version=1.8 via the 
maven-compiler-plugin configuration, the compiler throws errors saying "package 
XYZ does not exist" or "cannot find symbol ABC" where XYZ is the namespace 
defined in the thrift file and ABC is a struct/function in the thrift file.
3. If I add the dependency but specify the source/target version=1.7, I don't 
get any thrift related issues (so the thrift classes have compiled, I assume) 
but I get errors regarding features not supported in java 1.7, e.g., "lambda 
expressions are not supported in -source 1.5".

This makes me think that it is a version issue. I can share the pom file if 
that helps.

> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>Priority: Minor
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Commented] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-11 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4083:
---

I switched to thrift-maven-plugin as recommended above.

The plugin is generating code for Java 1.7; however, our other sources are for 
Java 1.8 so when I build with Java 1.8, the compiler is unable to find any of 
the packages/classes that are generated by thrift (Error: "package xyz does not 
exist"). On the other hand, dropping the Java version 1.7 doesn't work because 
the code uses Java 1.8 features such as lambdas.

Can you update the dependency to build with Java 1.8? Or is there a suggested 
workaround?

Thanks!

> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Reopened] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-11 Thread Manasi Vartak (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manasi Vartak reopened THRIFT-4083:
---

The thrift-maven-plugin doesn't work with java 1.8.

What's the recommended work around for it/can the pom.xml be updated to Java 
1.8?

> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Commented] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-10 Thread Manasi Vartak (JIRA)

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

Manasi Vartak commented on THRIFT-4083:
---

I see. We were using the maven plugin from 2013 
(https://mvnrepository.com/artifact/org.apache.thrift.tools/maven-thrift-plugin/0.1.11)
 and it worked without errors with Thrift 0.9.3 (which was the latest Thrift 
version until last month?), so assumed that would work with 0.10.0 as well.

We will switch to the other plugin. Thanks!



> maven-thrift-plugin doesn't work with thrift 0.10.0
> ---
>
> Key: THRIFT-4083
> URL: https://issues.apache.org/jira/browse/THRIFT-4083
> Project: Thrift
>  Issue Type: Dependency upgrade
>Affects Versions: 0.10.0
> Environment: Found on OS-X
>Reporter: Manasi Vartak
>
> maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.
> When compiling thrift sources (which worked with 0.9.3), the plugin throws 
> the following error:
> [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
> [ERROR] thrift failed output: 
> [ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
> java:hashcode



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


[jira] [Created] (THRIFT-4083) maven-thrift-plugin doesn't work with thrift 0.10.0

2017-02-10 Thread Manasi Vartak (JIRA)
Manasi Vartak created THRIFT-4083:
-

 Summary: maven-thrift-plugin doesn't work with thrift 0.10.0
 Key: THRIFT-4083
 URL: https://issues.apache.org/jira/browse/THRIFT-4083
 Project: Thrift
  Issue Type: Dependency upgrade
Affects Versions: 0.10.0
 Environment: Found on OS-X
Reporter: Manasi Vartak


maven-thrift-plugin (0.1.10) doesn't work with thrift 0.10.0.

When compiling thrift sources (which worked with 0.9.3), the plugin throws the 
following error:

[INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ project ---
[ERROR] thrift failed output: 

[ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option 
java:hashcode





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