Has anybody else lost their Python code? It has happened to me twice. I go to run my workflow and see that my few hundred lines of code have been deleted and replaced with the standard default:
Solved! Go to Solution.
Hi @patrick_digan,
As Python tool is based on Jupyter, you need to save your notebook content regularly.
Did you see the message box "Is it OK to leave/reload this page?" when you clicked out of the tool ?
Kind regards,
Paul Noirel
Sr Customer Support Engineer, Alteryx
Thanks @PaulN. I can't actually identify when my code becomes lost. My code works fine when I'm working exclusively in the python tool. Then I'll use the output from the tool and build out other parts of my workflow. I've been saving my alteryx file the whole time along the way. Then I come in the next day and tinker around with the tools. Then I open my python tool, and it's lost my code. So I'm not sure when in there it would have been lost (ie when I left the python tool, when I saved the workflow, when I opened the workflow, when I opened the python tool).
When you say "save your notebook regularly", what is the best method? Is it enough to just hit Control + S which saves my alteryx workflow? Or do I need to use the save and checkpoint functionality of the jupyter notebook?
Hi @patrick_digan,
So Jupyter has an autosave feature to prevent such loss. Default configuration for Python tool is located in file (for Designer admin):
C:\Program Files\Alteryx\bin\Miniconda3\etc\jupyter\custom\custom.js
with a default value of 1 second (1000 ms in file).
Pressing Ctrl+S when Python tool properties (Jupyter) is active will save the notebook as Jupyter shortcuts will take precedence over Designer.
So to sum up with your issue: you have saved your workflow but, on the next day, Python tool configuration was altered without you changing anything. Is that correct ?
I was wondering if issue could not be caused by the location of the notebook (%ENGINE.TEMPFILEPATH%\%TOOL_GUIDIR%\%TOOLID%), but Python tool has its own copy of the notebook (in attribute conveniently named "Notebook").
Do you use admin or non-admin version of the tool please ?
Thanks,
Paul Noirel
Sr Customer Support Engineer, Alteryx
@PaulN wrote:
So to sum up with your issue: you have saved your workflow but, on the next day, Python tool configuration was altered without you changing anything. Is that correct ?
I was wondering if issue could not be caused by the location of the notebook (%ENGINE.TEMPFILEPATH%\%TOOL_GUIDIR%\%TOOLID%), but Python tool has its own copy of the notebook (in attribute conveniently named "Notebook").
Do you use admin or non-admin version of the tool please ?
I'm using an admin version and running it non-elevated. Due to an issue with the Render tool, I have been elevating it at times yesterday/today.
Basically there are times where my python code is completely erased. Here is xml for my file:
So I'm not sure what I'm doing wrong, but it seems like that Notebook tag is lost. Shouldn't the notebook tag always persist with the code? I do have a temp folder with that GUIDir, but it doesn't have the "correct" code at this point. I have several versions of the same workflow (ie original, v2 and v3), and they all have the same GUIDir and ToolID. And it looks like I may have copied the python tool from another unrelated workflow as it has the same GUIDir.
Hi @patrick_digan,
Many thanks for all the details. Could you please log a case with Alteryx Customer Support (support@alteryx.com) so we could proceed with further analysis ?
Paul Noirel
Sr Customer Support Engineer, Alteryx
Hi @patrick_digan,
I believe that I have found something. Issue needs to be escalated internally. Meanwhile, could you please make sure that you close your workflow when you are away from the machine ?
Kind regards,
Paul Noirel
Sr Customer Support Engineer, Alteryx
@PaulN Thanks! Old habits die hard, but I will certainly try.
For what it's worth, I have been having this exact same issue. I will run Alteryx Designer as administrator, and save both the workflow and the Jupyter notebook (save and checkpoint) as I go. Yesterday, I ran the workflow, saved everything, and closed it out without receiving any popup windows. Today, I opened the workflow, and both Python tools in the workflow were reset to default. This loss has happened a few times now.