Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 61999

Passing Arguments to Notebooks with Magic

$
0
0

Hi All,

 

I'm trying to figure out how to use magic commands to run another notebook with an argument that has a variable as the value. Hopefully the example below explains it better. The idea is to pass a pipeline parameter to the notebook, for example a True/False variable on whether it's being run on dev, and have that also apply to another notebook being ran using magic.

 

Notebook1

isDev = True

%run Notebook2 {'isDev': isDev}

Notebook2

     print(str(isDev))

 

When I use a string instead of a variable as the argument value it works. Otherwise I get this error:

 

MagicUsageError: Cannot parse notebook parameters. More details please visit https://go.microsoft.com/fwlink/?linkid=2270136 --> JsonReaderException: Unexpected character encountered while parsing value: i. Path 'isDev', line 1, position 9.

 

Thanks!


Viewing all articles
Browse latest Browse all 61999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>