incubator-livy icon indicating copy to clipboard operation
incubator-livy copied to clipboard

[LIVY-527] added autocompletion api and implementation for ipython

Open wangqiaoshi opened this issue 6 years ago • 19 comments

What changes were proposed in this pull request?

add complete function in PySparkJobProcessor interface, so ReplDriver can get completion message from python

How was this patch tested?

post /sessions/{sessionId}/completion set kind=pyspark

wangqiaoshi avatar Oct 08 '18 07:10 wangqiaoshi

should set spark.pyspark.python ${ipython-path}

wangqiaoshi avatar Oct 08 '18 07:10 wangqiaoshi

Codecov Report

Merging #119 into master will decrease coverage by 2.44%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #119      +/-   ##
============================================
- Coverage     70.94%   68.49%   -2.45%     
+ Complexity      922      893      -29     
============================================
  Files           100      100              
  Lines          5500     5606     +106     
  Branches        828      840      +12     
============================================
- Hits           3902     3840      -62     
- Misses         1062     1214     +152     
- Partials        536      552      +16
Impacted Files Coverage Δ Complexity Δ
...scala/org/apache/livy/repl/PythonInterpreter.scala 47.53% <0%> (-0.6%) 9 <0> (ø)
.../main/java/org/apache/livy/rsc/ReplJobResults.java 0% <0%> (-100%) 0% <0%> (-2%)
...ain/java/org/apache/livy/rsc/driver/Statement.java 0% <0%> (-100%) 0% <0%> (-6%)
...in/java/org/apache/livy/rsc/driver/AddFileJob.java 0% <0%> (-100%) 0% <0%> (-3%)
...ava/org/apache/livy/rsc/driver/StatementState.java 0% <0%> (-93.34%) 0% <0%> (-9%)
...rc/main/java/org/apache/livy/rsc/BaseProtocol.java 52.12% <0%> (-22.35%) 1% <0%> (ø)
.../java/org/apache/livy/rsc/driver/SparkEntries.java 46.87% <0%> (-17.19%) 7% <0%> (-3%)
...main/java/org/apache/livy/rsc/ContextLauncher.java 66.01% <0%> (-15.62%) 13% <0%> (-5%)
...c/src/main/java/org/apache/livy/rsc/RSCClient.java 75.15% <0%> (-8.7%) 20% <0%> (-6%)
...ain/scala/org/apache/livy/utils/SparkYarnApp.scala 73.23% <0%> (-6.34%) 33% <0%> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d87a348...1cd30e1. Read the comment docs.

codecov-io avatar Oct 08 '18 08:10 codecov-io

Please follow the guidelines in the contribution guide (linked in the PR template). Mainly:

  • file a bug with a description of the problem / feature
  • provide a proper description of your PR (which will be the commit message when merged).

vanzin avatar Oct 08 '18 18:10 vanzin

Fix the bug : The completion function doesn't work in pyspark kind.

description: when pyspark run in ipython environment , kind pyspark completion work. this pr add complete function in PySparkJobProcessor interface, so ReplDriver can get completion message from python

How was this patch tested?

  1. post /sessions/{sessionId}/completion set kind=pyspark

wangqiaoshi avatar Oct 09 '18 02:10 wangqiaoshi

Please follow the contribution guide. It's linked in the PR template. In case you missed it: https://livy.incubator.apache.org/community/

You're supposed to replace the PR template with your description of the changes. And file a bug.

vanzin avatar Oct 09 '18 15:10 vanzin

ping @wangqiaoshi - that's a great improvement! do you mind fixing those minor issues after the last review thank you!

Tagar avatar Jan 15 '19 23:01 Tagar

ping @wangqiaoshi - that's a great improvement! do you mind fixing those minor issues after the last review thank you!

ok

wangqiaoshi avatar Jan 17 '19 14:01 wangqiaoshi

Some style issues, otherwise looks ok.

Can a test be written for this (e.g. in InteractiveIT)? Not sure how easy it is to hit the completion API from tests.

I have a doubt, InteractiveIT isn't find Kind . Because module livy - integration - the test not introduced livy - core - the parent, but Kind in module livy - core - the parent. I can't run InteractiveIT

wangqiaoshi avatar Feb 02 '19 04:02 wangqiaoshi

Sorry, totally missed your question. I'm also not sure I understand the question.

It would be really good to have some test for this. It doesn't need to be an integration tests, but it needs to be tested somehow. Otherwise the changes look good.

vanzin avatar Mar 14 '19 22:03 vanzin

What's the plan to merge this?

balamuruganvg avatar May 03 '19 09:05 balamuruganvg

Yes, it would be nice to implement this feature 👍

jepma avatar May 20 '19 13:05 jepma

ping @wangqiaoshi

Tagar avatar May 20 '19 21:05 Tagar

Hi @wangqiaoshi , any plan to merge this ? is still something missing ? thanks!

cyrilledelabre avatar Jul 25 '19 08:07 cyrilledelabre

Hi @wangqiaoshi, you would be doing a great favor for a lot of people if you could merge this. Thanks!

tsurushun avatar Sep 05 '19 04:09 tsurushun

Hello @wangqiaoshi , Please merge your great job!!

mnoji avatar Sep 05 '19 04:09 mnoji

Hello @wangqiaoshi I use jupyter pyspark kernel in livy yarn-cluster mode, and merged this patch in my livy。but jupyter notebook still cannot auto complete. I find jupyter auto completion seems not use livy autocompletion api,May you have some advices about this situation? Thanks

Jassy1994 avatar Sep 05 '19 09:09 Jassy1994

Any updates on merging this feature @wangqiaoshi ?

rragundez avatar Nov 02 '19 08:11 rragundez

Any updates on merging this feature @wangqiaoshi @vanzin ?

agsachin avatar Apr 21 '22 04:04 agsachin