Skip to content

Conversation

@vectorijk
Copy link
Contributor

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 in PythonProcess.sendAndGetResult because we have detected error in PythonInterpreter.pythonErrorIn

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

screen shot 2016-10-16 at 18 05 00

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

if (line.equals("...")) {
logger.warn("Syntax error ! ");
output.append("Syntax error ! ");
break;
Copy link
Contributor Author

@vectorijk vectorijk Oct 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break here could cause chaos afterwards.

@vectorijk
Copy link
Contributor Author

cc @zjffdu

@bzz
Copy link
Member

bzz commented Oct 17, 2016

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?

@vectorijk
Copy link
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.

@vectorijk
Copy link
Contributor Author

@bzz I have updated and added unit test.

@vectorijk
Copy link
Contributor Author

cc @Leemoonsoo @jongyoul

@Leemoonsoo
Copy link
Member

Tested and Looks great to me!

Thanks @vectorijk for the contribution!

@Leemoonsoo
Copy link
Member

Merge if there're no more discussions

@asfgit asfgit closed this in 1b2635c Oct 23, 2016
@vectorijk
Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants