Repository: spark
Updated Branches:
  refs/heads/master b86277c13 -> f38fab97c


SPARK-3265 Allow using custom ipython executable with pyspark

Although you can make pyspark use ipython with `IPYTHON=1`, and also change the 
python executable with `PYSPARK_PYTHON=...`, you can't use both at the same 
time because it hardcodes the default ipython script.

This makes it use the `PYSPARK_PYTHON` variable if present and fall back to 
default python, similarly to how the default python executable is handled.

So you can use a custom ipython like so:
`PYSPARK_PYTHON=./anaconda/bin/ipython IPYTHON_OPTS="notebook" pyspark`

Author: Rob O'Dwyer <[email protected]>

Closes #2167 from robbles/patch-1 and squashes the following commits:

d98e8a9 [Rob O'Dwyer] Allow using custom ipython executable with pyspark


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f38fab97
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f38fab97
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f38fab97

Branch: refs/heads/master
Commit: f38fab97c7970168f1bd81d4dc202e36322c95e3
Parents: b86277c
Author: Rob O'Dwyer <[email protected]>
Authored: Wed Aug 27 19:47:33 2014 -0700
Committer: Matei Zaharia <[email protected]>
Committed: Wed Aug 27 19:47:33 2014 -0700

----------------------------------------------------------------------
 bin/pyspark | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/f38fab97/bin/pyspark
----------------------------------------------------------------------
diff --git a/bin/pyspark b/bin/pyspark
index 01d4202..59cfdfa 100755
--- a/bin/pyspark
+++ b/bin/pyspark
@@ -104,7 +104,7 @@ if [[ "$1" =~ \.py$ ]]; then
 else
   # Only use ipython if no command line arguments were provided [SPARK-1134]
   if [[ "$IPYTHON" = "1" ]]; then
-    exec ipython $IPYTHON_OPTS
+    exec ${PYSPARK_PYTHON:-ipython} $IPYTHON_OPTS
   else
     exec "$PYSPARK_PYTHON"
   fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to