Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Python tool loses code

patrick_digan
17 - Castor
17 - Castor

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:

Capture.PNG

78 REPLIES 78
amirsemsar
8 - Asteroid

it happens with or without those warnings 

Flo_P
9 - Comet

I'm also experiencing this sporadically, sometimes it's just the last 1-2 lines written, sometimes the entire code section of the python tool is blank when opening it again.

Edit: Scratch that, now every time I open the workflow and go to the 'Interactive' view instead of 'Production' it completely resets the code.. How is this still a bug considering there are threads about this all the way back into 2018?

michael_porter
5 - Atom

I regualrly have this problem. Sometimes the code reappears but when this happens is seemingly random. This is after following best practice and saving before the notebook and workflow before closing. This seems to happen more often if the notebook has been inside a tool container that was turned off. 

amirsemsar
8 - Asteroid

The easy fix is import your script in and this way it only ever be lost. Do your dev elsewhere which is annoying I know.

LDUSER
5 - Atom

Hi,

It is 2023 and am running version 2022.1.1.42619 admin designer with no admin privileges and am still having this issue. Has this been resolved or slated to be resolved in future fix packs/releases?

abrown23
5 - Atom

I'm dealing with this issue in 2022.3.1.573 - never had the code disappear completely, but sometimes will just randomly revert back to a prior save - maybe the last save, or maybe several saves ago...and sometimes I notice immediately, and sometimes I don't and end up needing to make the same edits I already did because I've basically branched my code without realizing. very annoying. 

TimPowers
7 - Meteor

Checking up on this and glad there's discussion on the topic, but it appears others haven't enjoyed any update that has ensured a more stable working environment.

 

I've noticed this in my workflows for a while (2021.4). It's got to the point where my team routinely places a Comment tools above all Python tools to store a copy of the code. I initially thought the error had to do with copying Python tools (rather than pulling a brand new one down from the palette), yet I haven't noticed any consistency with loss of code - I usually save both the notebook and workflow file with each alteration. I definitely experience a 404 loss whenever a Python tool is on the non-receiving end of a Detour tool (so be sure to let the data flow through if you want to make revisions to a Python tool on the detour path).

 

Some of my workflows are pretty large (several thousand nodes) with many Python tools mixed in and I'm more recently finding certain Python tools will be entirely replaced with the contents of other Python tools. I think this behavior stops by pulling down a new tool in place of the offending tool, but this isn't a sustainable solution as long as I can't determine the consistency of the problem.

TimPowers
7 - Meteor

Trying to switch out currently-error Python tools for fresh ones hasn't solved the issue of code being entirely replaced with the contents of other Python tools, leading me to suspect that there's a limiting factor on the number of Python tools feasible in a given workflow.

apathetichell
19 - Altair

I believe the issue is that the venv is one venv for your entire Alteryx environment. The standard (non-Alteryx) way this is managed is via containerized environment for each python app/tool. In your situation - I might create a hypervisor workflow which spot checks the python code for in the underlying workflows xml vs a code repo (or series of ..py files service as the code repo) - and updates as needed. 

Labels
Top Solution Authors