Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Relation between Python Tool and Jupyter Notebook

Markus2
7 - Meteor

Hello

I have copied a workflow which contains a Python tool. Looks as if the corresponding Jupyter notebook has not been copied along with, but rather that the Python tools in the two workflows refer to the same notebook. Is this correct? If yes, how can one achieve to split them?

4 REPLIES 4
danilang
19 - Altair
19 - Altair

Hi @Markus2 

 

I was today year's old when I found out about this.   Not being familiar with the way Jupyter Notebook works, I thought it was just an environment for displaying the scripts embedded in the workflow.  But it seems that as long as the workflow and it's copy are open in Designer any change made to the script in one python tool will change the script in the other one.  If one of the workflows is closed when the change is made, the closed workflow .yxmd file is not modified until the workflow is opened in Designer at which point the script is refreshed from the notebook. 

 

I hope one of the Alteryx folks chimes in with an answer.  @TrevorS, could you possibly shed some light on this?

 

Dan 

 

      

PhilipMannering
16 - Nebula
16 - Nebula

To split them, you could simply,

1. Select all the cells (shift+j multiple times or shift and click the top and bottom cell)

2. Copy the cells (hit the c key)

3. Drop a new Python Tool

4. Paste the cells (hit the v key)

 

Voila.

Philip

 

MatthewP
Alteryx
Alteryx

Hello @Markus2 

 

The way that the notebooks are referenced are via a GUID that is within the workflow itself. This GUID is recreated whenever there is a new python tool placed on the canvas.

 

My suggestion is that if you need to make a copy of a workflow that has a python tool is to do the following:

 

  • Make a copy of the workflow itself
  • Open the newly created workflow in Designer
  • Select the Python tool and "copy" the tool itself (right click copy or ctrl C)
  • Then paste the Python tool back onto the canvas
  • Delete/replace the "original" copy of the tool

Lastly to confirm that this is indeed a different notebook reference you can open the two workflows in notepad++ and look for the GUID number and they should be different see my screen shot below where I followed these steps and compared the GUID number.

 

Capture.PNG

Markus2
7 - Meteor

Thanks to all for your answers

@PhilipMannering The way you outlined was also the way I worked around that issue.

@MatthewP : Just went through all your steps. Worked perfectly well 🙂

 

Labels