Skip to content

Conversation

@bzz
Copy link
Member

@bzz bzz commented Jun 22, 2016

What is this PR for?

Display Pandas DataFrame using Zeppelin's Table Display system.

What type of PR is it?

Feature

Todos

  • fix NPE in logs on empty paragraph execution
  • matplotlib: refactor zeppelin_show(plt) -> z.show(plt)
  • pandas: support z.show(df)
  • update docs

What is the Jira issue?

ZEPPELIN-1048

How should this be tested?

"Zeppelin Tutorial: Python - matplotlib basic" should work, and

import pandas as pd
rates = pd.read_csv("bank.csv", sep=";")
z.show(rates)

Screenshots (if appropriate)

screen shot 2016-06-23 at 10 29 00

Questions:

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

@bzz
Copy link
Member Author

bzz commented Jun 22, 2016

It is ready to be merged now, \cc @minahlee for review.

TODOs will be addressed in a different PR, after #1063 is merged

@Leemoonsoo
Copy link
Member

I saw https://issues.apache.org/jira/browse/ZEPPELIN-1048 marked 0.7.0 as a fix version.

Not a strong opinion, and i don't think it should be blocker for 0.6 release. But If we're going to change api from zeppelin_show(plt) to z.show(plt), how about apply this api change to 0.6 branch?

While zeppelin_show() introduced recently, now API change cost is not high. But once 0.6.0 released and people starts use zeppelin_show(), API change cost will be increased.

zeppelin_show(plt,width='50px')
zeppelin_show(plt,height='150px')
zeppelin_show(plt, width='50px')
zeppelin_show(plt, height='150px')
Copy link
Member

Choose a reason for hiding this comment

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

This also need to be changed to z.show() I guess?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, of course it should. Commit addressing it was lost on rebasing.

@minahlee
Copy link
Member

I left few notes on documentation and help() function. Looks good to me.

@bzz
Copy link
Member Author

bzz commented Jun 23, 2016

Thank you guys for the prompt reviews!

@Leemoonsoo agree on API change cost and I'm glad to have it merged in 0.6, updated JIRA
@minahlee review addressed in 3b1ad36

If there is no more discussion, going to merge it to master and branch-0.6

@asfgit asfgit closed this in 230d890 Jun 23, 2016
@bzz
Copy link
Member Author

bzz commented Jun 23, 2016

cherry-picking to branch-0.6 fails with merge conflicts as master and branch-0.6 diverged.
Will merge it manually as discussed above, but it's very error-prone

asfgit pushed a commit that referenced this pull request Jun 23, 2016
Display Pandas DataFrame using Zeppelin's Table Display system.

Feature

* [x] fix NPE in logs on empty paragraph execution
* [x] matplotlib: refactor `zeppelin_show(plt)` -> `z.show(plt)`
* [x] pandas: support `z.show(df)`
* [x] update docs

[ZEPPELIN-1048](https://issues.apache.org/jira/browse/ZEPPELIN-1048)

"Zeppelin Tutorial: Python - matplotlib basic" should work, and

```python
import pandas as pd
rates = pd.read_csv("bank.csv", sep=";")
z.show(rates)
```
![screen shot 2016-06-23 at 10 29 00](https://cloud.githubusercontent.com/assets/5582506/16289133/85f0ddbc-392d-11e6-86a3-28d10e73f68d.png)

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

Author: Alexander Bezzubov <bzz@apache.org>

Closes #1067 from bzz/python/pandas-support and squashes the following commits:

3b1ad36 [Alexander Bezzubov] Python: update docs to reffer new API
ee6668b [Alexander Bezzubov] Python: update docs, add Pandas integration
71be418 [Alexander Bezzubov] Python: limit 1000 for table display system on DataFrame
52e787d [Alexander Bezzubov] Python: pandas DataFrame using Table display system
bc91b86 [Alexander Bezzubov] Python: skip interpreting empty paragraphs
a7248cd [Alexander Bezzubov] Python: draft of pandas support
15646a1 [Alexander Bezzubov] Python: refactoring to z.show()

(cherry picked from commit 230d890)
Signed-off-by: Alexander Bezzubov <bzz@apache.org>

Conflicts:
	docs/interpreter/python.md
	python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java
	python/src/main/resources/bootstrap.py
	python/src/main/resources/bootstrap_input.py
@bzz
Copy link
Member Author

bzz commented Jun 23, 2016

done in 97f25e2

@bzz bzz deleted the python/pandas-support branch June 23, 2016 13:42
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