You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by prabhjyotsingh <gi...@git.apache.org> on 2018/01/12 17:16:06 UTC
[GitHub] zeppelin pull request #2729: [ZEPPELIN-2826] support for carriage return '\r...
GitHub user prabhjyotsingh opened a pull request:
https://github.com/apache/zeppelin/pull/2729
[ZEPPELIN-2826] support for carriage return '\r', on result window
### What is this PR for?
This PR implements carriage return '\r' on result window, currently since HTML treats "\n", "\r" and "\r\n" equally.
### What type of PR is it?
[Improvement]
### What is the Jira issue?
* [ZEPPELIN-2826](https://issues.apache.org/jira/browse/ZEPPELIN-2826)
### How should this be tested?
Here is a sample code to test it
```
%python
import time,sys
end_val = 10
bar_length = 20
for i in xrange(0, end_val + 1):
time.sleep(0.5)
percent = float(i) / end_val
hashes = '#' * int(round(percent * bar_length))
spaces = ' ' * (bar_length - len(hashes))
sys.stdout.write("\rPercent: [{0}] {1}%".format(hashes + spaces, int(round(percent * 100))))
#print "Percent: [{0}] {1}%".format(hashes + spaces, int(round(percent * 100)))
```
### Screenshots (if appropriate)
![after2](https://user-images.githubusercontent.com/674497/34886813-55e6e2d8-f7ea-11e7-9e40-24ded6631d75.gif)
### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/prabhjyotsingh/zeppelin ZEPPELIN-2826
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2729.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2729
----
commit 4511eec3a1e7df62c09ab0fdfa47fde5ba1ffa8e
Author: Prabhjyot Singh <pr...@...>
Date: 2018-01-12T16:54:15Z
ZEPPELIN-2826: support for carriage return '\r', on result
Change-Id: If7e953718b19de56808276fd695ea0a5582b4277
----
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by prabhjyotsingh <gi...@git.apache.org>.
Github user prabhjyotsingh commented on the issue:
https://github.com/apache/zeppelin/pull/2729
I now see what you were saying earlier, let me check if there is a quick fix for this.
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by prabhjyotsingh <gi...@git.apache.org>.
Github user prabhjyotsingh commented on the issue:
https://github.com/apache/zeppelin/pull/2729
I think that can be adjusted via `zeppelin.interpreter.output.limit`? Or help me understand if you meant something else.
---
[GitHub] zeppelin pull request #2729: [ZEPPELIN-2826] support for carriage return '\r...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/zeppelin/pull/2729
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:
https://github.com/apache/zeppelin/pull/2729
Thanks @prabhjyotsingh The PR LGTM overall
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:
https://github.com/apache/zeppelin/pull/2729
@prabhjyotsingh Could you check this commit ? https://github.com/zjffdu/zeppelin/commit/00bce395f3ed557eb822095f490dae5f8bfd5a23
I tested it locally, and works well.
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by prabhjyotsingh <gi...@git.apache.org>.
Github user prabhjyotsingh commented on the issue:
https://github.com/apache/zeppelin/pull/2729
That works well, have merged that commit to this PR.
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by prabhjyotsingh <gi...@git.apache.org>.
Github user prabhjyotsingh commented on the issue:
https://github.com/apache/zeppelin/pull/2729
Thanks for the review will merge this if no more discussion.
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:
https://github.com/apache/zeppelin/pull/2729
Thanks @prabhjyotsingh, it is really useful. I tried it, it works very well. Just one minor issue, the output size might needs to be adjusted, other it is very easy to get the following issue.
![screen shot 2018-01-13 at 9 19 19 am](https://user-images.githubusercontent.com/164491/34901252-e64b379a-f842-11e7-8d11-78353931f826.png)
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:
https://github.com/apache/zeppelin/pull/2729
What I mean is that we need the ajust how to calculate the `size` in `InterpreterOutput`. Because as you can see in the above screenshot, the output size in front end is not so large, but still get the problem of exceeding `ZEPPELIN_INTERPRETER_OUTPUT_LIMIT`, I believe this is because in `InterpreterOutput` we would always increase the `size` no matter whether it contains `\r`.
---
[GitHub] zeppelin issue #2729: [ZEPPELIN-2826] support for carriage return '\r', on r...
Posted by prabhjyotsingh <gi...@git.apache.org>.
Github user prabhjyotsingh commented on the issue:
https://github.com/apache/zeppelin/pull/2729
@zjffdu That "calculation" looks like a bigger change and might change the content of notebook as well.
---