Wednesday, 07 April 2021 07:04

Hands-On Tutorial: Script and deploy Python with the new Jupyter operator in SAP Data Intelligence

Written by Andreas Forster
Rate this item
(0 votes)
Source https://blogs.sap.com/2021/04/08/hands-on-tutorial-script-and-deploy-python-with-the-new-jupyter-operator-in-sap-data-intelligence/
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”

The new Jupyter operator brings interactive Python Notebooks into your SAP Data Intelligence pipelines. Script your notebook directly in the pipeline and deploy exactly the same notebook and pipeline into production. No need to script in one place and to copy / paste the code into a Python operator.

Learn how to use the operator with a Machine Learning example, that forecasts multiple time-series in SAP HANA using the embedded Automated Predictive Library.

With Python you can implement a million things, other than Machine Learning by the way. Data retrieval or data preparation or just two further uses cases.

The Jupyter operator was released in the first quarter of 2021 with SAP Data Intelligence Cloud, version 2013. Currently (April 2021) this functionality is not available in the on-premise release.

To implement the code in this blog, you also need to have access to a SAP HANA environment, which has the Automated Predictive Library installed. The trial of SAP HANA Cloud currently does not include that Automated Machine Learning library.

This hands-on tutorial assumes you are already familiar with both Jupyter notebooks and running basic graphs (which are also called pipelines) in SAP Data Intelligence. If you are new to the tool, you might benefit from the “Get Started” portal.

Let’s keep it simple at first, with a very basic example. Use the Jupyter operator to send a signal every few seconds.

Open the “Modeler” and create a new, blank graph. Drag the Jupyter operator onto the canvas and give to it an “Output Port”, named “out”, of basic type “string”. Connect the output port with a Wiretap operator.

In order to open a Jupyter notebook to script in Python:

  • You must specify a name for the notebook in the operator’s settings. The operator will create the notebook for you. If the pipeline is used in a Machine Learning scenario, you can also provide the name of a notebook that has already been created in the Machine Learning scenario.
  • The Jupyter operator also has to be in none-Productive mode. This is the default setting, more on this later.
  • The pipeline has to be running!

Set the “Notebook File Path” to: ping. Then save and run the pipeline.

With the pipeline running, you can now open the operator’s User Interface, the notebook.

Continue reading here
Read 57 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.