[Zeppelin-1555] Eliminate prefix in PythonInterpreter exception#1530
Closed
vectorijk wants to merge 2 commits intoapache:masterfrom
Closed
[Zeppelin-1555] Eliminate prefix in PythonInterpreter exception#1530vectorijk wants to merge 2 commits intoapache:masterfrom
vectorijk wants to merge 2 commits intoapache:masterfrom
Conversation
vectorijk
commented
Oct 17, 2016
| if (line.equals("...")) { | ||
| logger.warn("Syntax error ! "); | ||
| output.append("Syntax error ! "); | ||
| break; |
Contributor
Author
There was a problem hiding this comment.
break here could cause chaos afterwards.
Contributor
Author
|
cc @zjffdu |
Member
|
Thank you for contributing! How do you think, how hard would be to add some tests here, to make sure the change does not break things? |
Contributor
Author
|
@bzz Thanks for the quick response! I will write and update some tests for this to make sure the changes doesn't break things before. |
Contributor
Author
|
@bzz I have updated and added unit test. |
Contributor
Author
Member
|
Tested and Looks great to me! Thanks @vectorijk for the contribution! |
Member
|
Merge if there're no more discussions |
Contributor
Author
|
@Leemoonsoo @bzz Thanks for the review! |
darionyaphet
pushed a commit
to darionyaphet/zeppelin
that referenced
this pull request
Oct 27, 2016
### What is this PR for? Solve bug metioned [here](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java#L139) Since we launch python interpreter as a process and redirect stdin and stdout, only exception occurred (like syntax error or indentation error, etc) could give string like `...`. Thus, we don't need to determine whether syntax error happened in [`PythonProcess.sendAndGetResult`](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonProcess.java#L86) because we have detected error in [`PythonInterpreter.pythonErrorIn`](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java#L152) ### What type of PR is it? Bug Fix ### What is the Jira issue? Jira: https://issues.apache.org/jira/browse/ZEPPELIN-1555 ### How should this be tested? Test locally. ### Screenshots <img width="1175" alt="screen shot 2016-10-16 at 18 05 00" src="https://cloud.githubusercontent.com/assets/3419881/19422552/192a8b3a-93cb-11e6-89e8-63f2652a7f85.png"> ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Kai Jiang <[email protected]> Closes apache#1530 from vectorijk/zeppelin-1555 and squashes the following commits: 8ffc360 [Kai Jiang] add unit test d7a2ef4 [Kai Jiang] [zeppelin-1555] Eliminate prefix in PythonInterpreter exception
pedrozatta
pushed a commit
to pedrozatta/zeppelin
that referenced
this pull request
Oct 27, 2016
### What is this PR for? Solve bug metioned [here](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java#L139) Since we launch python interpreter as a process and redirect stdin and stdout, only exception occurred (like syntax error or indentation error, etc) could give string like `...`. Thus, we don't need to determine whether syntax error happened in [`PythonProcess.sendAndGetResult`](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonProcess.java#L86) because we have detected error in [`PythonInterpreter.pythonErrorIn`](https://github.com/apache/zeppelin/blob/3dec4d7006b8a57136f34ae330ba937d8990f2d2/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java#L152) ### What type of PR is it? Bug Fix ### What is the Jira issue? Jira: https://issues.apache.org/jira/browse/ZEPPELIN-1555 ### How should this be tested? Test locally. ### Screenshots <img width="1175" alt="screen shot 2016-10-16 at 18 05 00" src="https://cloud.githubusercontent.com/assets/3419881/19422552/192a8b3a-93cb-11e6-89e8-63f2652a7f85.png"> ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Kai Jiang <[email protected]> Closes apache#1530 from vectorijk/zeppelin-1555 and squashes the following commits: 8ffc360 [Kai Jiang] add unit test d7a2ef4 [Kai Jiang] [zeppelin-1555] Eliminate prefix in PythonInterpreter exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
Solve bug metioned here
Since we launch python interpreter as a process and redirect stdin and stdout, only exception occurred (like syntax error or indentation error, etc) could give string like
.... Thus, we don't need to determine whether syntax error happened inPythonProcess.sendAndGetResultbecause we have detected error inPythonInterpreter.pythonErrorInWhat type of PR is it?
Bug Fix
What is the Jira issue?
Jira: https://issues.apache.org/jira/browse/ZEPPELIN-1555
How should this be tested?
Test locally.
Screenshots

### Questions: - Does the licenses files need update? No - Is there breaking changes for older versions? No - Does this needs documentation? No