web analytics

DataLabNotebookRunner Script Support

Composable now supports running Python scripts from DataLabs using the DataLab Notebook Runner Module. This is useful in production environments where you wish to run DataLab code without the overhead of spinning up a notebook.

The above script and notebook Modules simply add the two numbers labeled with variables a and b together.

Stats:
13.202s .ipynb Notebook vs 0.025s .py Script by running the script directly and bypassing overhead of running notebooks with Papermill.

DataLab notebooks can easily be converted by using the built in export menu shown above. Simply click “Save and Export Notebook As…”->”Executable Script”.

NOTE: You will need to remove the Parameters cell as it is not necessary for the Python script to run. Simply pass in your parameters as normal in the DataFlow. You will also need to handle imports within function definitions to make them global as appropriate.