Skip to content

Conversation

@bzz
Copy link
Member

@bzz bzz commented Jul 4, 2016

What is this PR for?

Implement paragraph ERROR status for Python interpreter in case of Error or Exception in the output.

What type of PR is it?

Improvement

What is the Jira issue?

ZEPPELIN-1105

How should this be tested?

CI should pass, or

mvn "-Dtest=org.apache.zeppelin.python.PythonInterpreterWithPythonInstalledTest" test -pl python

should pass, or paragraph status should be ERROR for something like

import some-thing

Screenshots (if appropriate)

screen shot 2016-07-04 at 21 30 23

Questions:

  • Does the licenses files need update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

@bzz bzz changed the title ZEPPELIN-1105: Python - add paragraph ERROR status on Error or Exception ZEPPELIN-1105: Python - add paragraph ERROR status Jul 4, 2016
@bzz
Copy link
Member Author

bzz commented Jul 4, 2016

Ready to merge, \cc @minahlee @jongyoul for review

@bzz bzz closed this Jul 4, 2016
@bzz bzz reopened this Jul 4, 2016
@bzz bzz force-pushed the ZEPPELIN-1105/python/add-paragraph-error-statu branch from e68fae8 to a7bf8f3 Compare July 5, 2016 05:17
@bzz
Copy link
Member Author

bzz commented Jul 5, 2016

reabsed on latest master
ping @khalidhuseynov @minahlee @jongyoul for a review

@minahlee
Copy link
Member

minahlee commented Jul 5, 2016

Tested basic functionality. Looks good to me.

CI failure is irrelevant and being taken care of under #1129.

@bzz
Copy link
Member Author

bzz commented Jul 5, 2016

Thank you @minahlee for prompt review and notice on CI fix, I really appreciate!

Merging if there is no more discussion

@bzz bzz closed this Jul 5, 2016
@bzz bzz reopened this Jul 5, 2016
private Boolean py4J = false;
private Boolean py4JisInstalled = false;
private InterpreterContext context;
private Pattern errorInLastLine = Pattern.compile(".*(Error|Exception): .*$");
Copy link
Member

Choose a reason for hiding this comment

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

this seems rather fragile, it would match something like:

there is no Error: ok

Copy link
Member

@felixcheung felixcheung Jul 5, 2016

Choose a reason for hiding this comment

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

Maybe we should put user code under try ... except or re-direct sys.stderr and check for non-empty value, as an alternative?

Copy link
Member Author

@bzz bzz Jul 5, 2016

Choose a reason for hiding this comment

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

Good points, thank you @felixcheung !

There is definitely room for improvement - this is more like a foundation of this feature, as previous impl always returned SUCCESS.

Your example of print("there is no Error: ok") will indeed trigger the the false positive ERROR status.

I have filed ZEPPELIN-1114 and logged this feedback there. I plan to take care of it in a subsequent PRs.

Please let me know what you think!

@felixcheung
Copy link
Member

I think this is a good improvement - left a comment.

@bzz
Copy link
Member Author

bzz commented Jul 5, 2016

CI is green now

@asfgit asfgit closed this in 2ee7f48 Jul 5, 2016
@bzz bzz deleted the ZEPPELIN-1105/python/add-paragraph-error-statu branch July 5, 2016 08:59
PhilippGrulich pushed a commit to SWC-SENSE/zeppelin that referenced this pull request Aug 8, 2016
### What is this PR for?
Implement paragraph ERROR status for Python interpreter in case of Error or Exception in the output.

### What type of PR is it?
Improvement

### What is the Jira issue?
[ZEPPELIN-1105](https://issues.apache.org/jira/browse/ZEPPELIN-1105)

### How should this be tested?
CI should pass, or

```
mvn "-Dtest=org.apache.zeppelin.python.PythonInterpreterWithPythonInstalledTest" test -pl python
```

should pass, or paragraph status should be ERROR for something like

```
import some-thing
```

### Screenshots (if appropriate)
![screen shot 2016-07-04 at 21 30 23](https://cloud.githubusercontent.com/assets/5582506/16560453/8fd0dddc-422e-11e6-9977-c3aea052db39.png)

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

Author: Alexander Bezzubov <bzz@apache.org>

Closes apache#1124 from bzz/ZEPPELIN-1105/python/add-paragraph-error-statu and squashes the following commits:

a7bf8f3 [Alexander Bezzubov] Python: add missing license header
b585982 [Alexander Bezzubov] Python: include Python-dependant tests to 1 CI profile
e7d5371 [Alexander Bezzubov] Python: add ERROR paragraph status on Error and Exception in output
4c1107b [Alexander Bezzubov] Refactoring: rename and extract var assignment
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