I have a python 3.5 notebook in databricks. I have a requirement to execute databricks notebook cells based on some conditions. I didn't see any functionality out of the box.
I have tried creating a python egg with the below code and installed it in databricks cluster.
def skip(line, cell=None):
'''Skips execution of the current line/cell if line evaluates to True.'''
if eval(line):
return
get_ipython().ex(cell)
def load_ipython_extension(shell):
'''Registers the skip magic when the extension loads.'''
shell.register_magic_function(skip, 'line_cell')
def unload_ipython_extension(shell):
'''Unregisters the skip magic when the extension unloads.'''
del shell.magics_manager.magics['cell']['skip']
But while I'm trying to load that with extension using %load_ext skip_cell it's throwing an error saying "The module is not an IPython module". Any help or suggestion is appreciated. Thanks.