This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
With 19.1, we've added some new features to our Python SDK!
An XML string attribute for ToolFamily was added for the ToolNameConfig.xml and the outer config.xml of a YXI. Python SDK tools can now be grouped together to share dependencies and a single python virtual environment. This allows for a common site-packages path that is shared between all Python SDK tools that are of the same ToolFamily.
An XML string attribute for ToolFamilyGlobalStateGroup was added to the ToolNameConfig.xml file. If two tools in the same ToolFamily have ToolFamilyGlobalStateGroup to the same value, the tools will share the same subinterpreter. Additionally, the tools will share the same global state and global variables.
Messaging function DebugMessageOut. This function displays messages in the console or Results window if the flag EnableDebugMessages is set to True on the workflow for tools utilizing the Python SDK (more details on implementation are below).
FYI - ToolFamily is only applicable to tools built with the Python SDK. Previous versions of custom tools that do not include ToolFamily or ToolFamilyGlobalStateGroup in the config XML files will continue working in Alteryx 19.1.
The purpose of ToolFamily and ToolFamilyGlobalStateGroup is to consolidate virtual environments. This will save you space and allow you to logically group tools together, like connectors or machine learning tools, that share common Python packages. An example of using ToolFamily and ToolFamilyGlobalStateGroup in the ToolNameConfig.xml file is below. If you have multiple Python SDK tools that you would like to share the same virtual environment (venv), specify a ToolFamily value that will be consistent across the tools. The venv will be installed in the same directory as the tools and it will be named ToolFamily_venv. For the example below, it will be a new folder named multitool_venv.
Additionally, you may choose some tools from the ToolFamily to share the same global state. In order to do that, the value for ToolFamilyGlobalStateGroups must be consistent between tools.
If you wish to package tools within the same ToolFamily in a single YXI, make sure the ToolFamily value in the outer Config.xml matches the ToolFamily within.
But what about the requirements.txt file, you may be asking? Can you get by with just one per ToolFamily? Technically, yes, but it is still good practice to include a requirements.txt for each tool. Your future self might thank you if you have to break the family up!
The DebugMessageOut method is a great way to add debug messages to your code and not have to worry about deleting or commenting them out once your tool is in production.
How to use it:
self.alteryx_engine.debug_message_out(self.n_tool_id,Sdk.EngineMessageType.info,"This is my python debugger")
In order to enable that message to appear in the Results window or console, the EnableDebugMessages constant must be set to True. In Alteryx, under the workflow tab of the Workflow-Configuration window, click the plus sign and type 'EnableDebugMessages' for the Name and set the value to True. If that constant is not defined for a workflow, that value is set to False by default.
Troubleshooting Guide for ToolFamily:
YXI Error: “The installation failed. ToolFamily is not allowed to be empty or white space.”
What does this mean? If ToolFamily is included in the ToolNameConfig.xml file, the value must not be empty or include spaces.
YXI Error: “The installation failed. ToolFamily must match for all tools included a yxi file.”
What does this mean? The ToolFamily value must be consistent between the ToolNameConfig.xml file and the outer config.xml file in a YXI installer.
Problem: if a Python SDK tool in a ToolFamily produces an error and is removed from the canvas, the error may persist even if the tool is no longer in the workflow
Try working in a new, blank workflow
Error in Designer: Designer x64: The Designer x64 reported: InboundNamedPipe GetOverlappedResult: The pipe has been ended.
What does this mean? Tools in the same ToolFamily must be installed as admin or non-admin, no mix and match.
Problem: Alteryx is throwing an error that it can't load a library
What does this mean? If you installed multiple tools via a single YXI and any one of them failed, the virtual environment will not be set up properly, so even tools that were “successfully installed” will not work.