Engine Works

Under the hood of Alteryx: tips, tricks and how-tos.





Step 1: Make your Python SDK tool following this helpful post from SydneyFs online grimoire





While we are sure you are all at the top of your wizarding class, we know our tool just won’t run perfectly the first time around...let’s see how using Pdb can help!



































Step 2: Create a workflow using your new tool, making sure to configure it with the settings you would like to test


















Step 3: Save your workflow to the debug_workflows folder (snakeplane > pilot > debug_workflows) with the same name as your tool (YourToolsName.yxmd); if a debug_workflows folder does not exist create one





Before we continue, let’s learn a little bit about the Pdb code/commands we are going to use in our next steps:

For a full list of Pdp commands, click here


































Pro-tip: If you just hit enter, Pdp will run the last command you entered in the terminal



OK, let’s move on to the next step in our debugging tutorial quest....
































Step 4: Open your main.py script in your favorite editor and insert import pdb; pdb.set_trace() where you would like to start debugging your code and click save





Step 5: If you haven’t done so already, activate and freeze your environment




Step 6: Next you will need to build your tool with the following command: inv build <your_tool_name>

  • Note, every time you make changes to your main.py script you will need to rebuild your tool




Step 7: Change your directory to the debug_workflows directory












Step 8: Run the workflow you created in the debug_workflows folder from the command line using the following command "C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe” <yourworkflow.yxmd>




Your script will run up until the spot where you placed import pdb; pdb.set_trace(). You will know you are in the Python debugger when you see (Pdb) on the current line of your terminal




OK, from here we can start casting our debugging spells!





















  • h for help: I want to see the documentation for the p command or a listing of all the documented commands

    • h.PNG















  • p to print; pp to print-pretty: I want to see the value of an expression (e.g., a variable) in it’s current context

    • C3PO_17-1585354178821.png



  • q for quit: I want to quit the debugger

    • q.PNG

This concludes the tutorial, but if your thirsty for another mug of Pdb butter beer,check out this post by JPKa. Happy debugging Alteryx Python SDK wizards!

11 - Bolide

A helpful article @C3PO ! However, it appears the Pesky Pixies have attacked the HTML in this article. Can Hermione fix it? 🙂