From e34071e5dd5b9858139b89cfd085167f22e7f708 Mon Sep 17 00:00:00 2001 From: Romeo Kienzer Date: Tue, 10 Aug 2021 13:26:48 +0000 Subject: [PATCH] sync with elyra main library --- component-library/input/input-hmp.ipynb | 12 +++++++++++- component-library/train/spark-train-lr.ipynb | 7 ++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/component-library/input/input-hmp.ipynb b/component-library/input/input-hmp.ipynb index bf83bcc9..dc35c92b 100644 --- a/component-library/input/input-hmp.ipynb +++ b/component-library/input/input-hmp.ipynb @@ -14,7 +14,17 @@ "metadata": {}, "outputs": [], "source": [ - "!pip install pyspark==2.4.4" + "%%bash\n", + "export version=`python --version |awk '{print $2}' |awk -F\".\" '{print $1$2}'`\n", + "\n", + "if [ $version == '36' ]; then\n", + " pip install pyspark==2.4.8 wget==3.2 pyspark2pmml==0.5.1\n", + "elif [ $version == '38' ]; then\n", + " pip install pyspark==3.1.2 wget==3.2 pyspark2pmml==0.5.1\n", + "else\n", + " echo 'Currently only python 3.6 and 3.8 is supported, in case you need a different version please open an issue at https://github.com/elyra-ai/component-library/issues'\n", + " exit -1\n", + "fi" ] }, { diff --git a/component-library/train/spark-train-lr.ipynb b/component-library/train/spark-train-lr.ipynb index dfc31682..28d93496 100644 --- a/component-library/train/spark-train-lr.ipynb +++ b/component-library/train/spark-train-lr.ipynb @@ -48,7 +48,8 @@ "from pyspark.ml.feature import StringIndexer\n", "from pyspark.ml.feature import VectorAssembler\n", "from pyspark.ml.feature import MinMaxScaler\n", - "import sys" + "import sys\n", + "import wget" ] }, { @@ -61,8 +62,8 @@ " url = ('https://github.com/jpmml/jpmml-sparkml/releases/download/1.7.2/'\n", " 'jpmml-sparkml-executable-1.7.2.jar')\n", " wget.download(url)\n", - " shutil.copy('jpmml-sparkml-executable-1.7.2.jar', site.getsitepackages()[0]\n", - " '/pyspark/jars/')\n", + " shutil.copy('jpmml-sparkml-executable-1.7.2.jar',\n", + " site.getsitepackages()[0] + '/pyspark/jars/')\n", "elif sys.version[0:3] == '3.6':\n", " url = ('https://github.com/jpmml/jpmml-sparkml/releases/download/1.5.12/' \n", " 'jpmml-sparkml-executable-1.5.12.jar')\n",