community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Alteryx Python Tool - Macro code caching bug

Asteroid

Ok so this is pretty frustrating. I have been building a macro to enable alteryx to have a direct line of communication with an API for a cloud based viz tool we use.

 

I have started to build macros in Alteryx and use python tool for when I need some python because this is wayyyyy quicker than building something via the python/html sdks. Generally this is great, however...

 

Today, when I got my macro working as a workflow (just running the yxmc with the test inputs) and had successful communication with the API, I went to test it as a macro tool in another workflow. It failed with the exact same inputs. The tool would also spit out different errors on different runs - sometimes RangeIndex obj isn't iterable, sometimes another object doesn't exist, etc.

 

I was unable to reproduce any of these errors in the macro. Eventually, I got an error that threw me a traceback in the macro. I copied it and put it into a text editor and, to my frustrated amazement, the macro had been running code from yesterday. No amount of saving (in jupyter or the macro itself) or restarting my computer fixed this. Eventually I deleted the tool and put my code into a new tool and now it works.

 

This has been frustrating so hopefully I can stop other people from being frustrated as well. Its pretty hard to debug code when your code is secretly replaced with an older iteration. I haven't been able to find a rewrite cache (or .pyc if that is what it is) anywhere either.

 

My frustration also stems from my process as when I was drafting my code, I had some blanket error handling (except:) which increased the amount of time before I realized the code was old.

 

Things that happened that could have contributed to this failure:

I renamed the tool

The kernel died/I restarted it a few times

There are two python tools in the workflow

Alteryx
Alteryx

Hi @WillBowman

 

Could you post the macro with this issue and an example workflow where is reoccurs? I could try to reproduce it and research further. 

 

Asteroid

Hi Eric,

 

Sorry for the late response and thank you in advance for the help.

 

Here is the macro, though I am not sure if you will be able to reproduce this error.

 

I've been looking a little further into how/where Jupyter is managed and those jupyterPipes.json and ipynb files in ProgramData may have something to do with it. Like the macro is trying to read an old file while the workflow is read/writing with new or in memory file.

 

Additionally, the jupyterPipes.json files have created an issue with concurrently utilizing macros for us, as it appears a lock is place on the relevant jupyterPipes.json when the macro is run in one instance, causing a concurrent instance (like a runner file) to fail due to access denied/write failure.

 

Thank again,

Will

Alteryx
Alteryx

Hi @WillBowman 

 

I couldn't find this as a known and documented issue. Maybe accessing the Jupyter logs for the Python tool and increasing the logging level would provide some more details about what is occurring.

 

Obtain Jupyter logs for the Python Tool

Increase Logging Level for the Python tool Interface

 

Thanks, 

 

Eric 

Labels