Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Execution of original Python macros on Alteryx Server 2024.2

T-Ishii
6 - Meteoroid

I tried running a workflow that had been working on Alteryx Server 2023.2 on Alteryx Server 2024.2, but encountered the attached error.

This workflow uses a Python macro to upload files to Amazon S3, and it seems the error is occurring within that macro.

If you happen to know how to resolve this issue, I would greatly appreciate your guidance.

If any additional information is needed, please let me know.

 

8 REPLIES 8
KGT
13 - Pulsar

This could be an issue with the tool needing to be re-installed. That depends on what that Python Macro is.

 

If it's a yxi install, then it will need to be re-installed on the new Alteryx Server, as the Python version changed in 2024.1 I believe. When a yxi tool is installed, it is "paired" to the version of Python in Alteryx, so when that version changes, the yxi tools need to be re-installed so that they "pair" with the new version. You will be able to download the correct version tool for your Alteryx Version.

 

If it's just a macro with a python tool in it, then looks like an issue with setting data_bytes on line 65...

 

Is this using Pandas? line_terminator changed to lineterminator (check that before using) in one of the versions I think, and so if Pandas (default install with Alteryx) has changed versions, that may explain it.

 

Screenshot 2025-09-19 175115.png

OTrieger
14 - Magnetar

@T-Ishii 
It might be due to a python version, or the package version.

As per the error TypeError: NDFrame.to_csv() got an unexpected keyword argument 'line_terminator' occurs because the line_terminator parameter is not supported in the version of pandas you are using, or it is being used incorrectly. 

 

The line_terminator parameter was removed in newer versions of pandas (starting with pandas 2.0.0, released in April 2023). If you're using a version of pandas >= 2.0.0, the to_csv() method no longer accepts line_terminator as a valid argument, leading to this error. 

 

What might happened that the new server have a newer pandas version that kicking this error. If that is the case you will need to update the python code with the new syntax. Try to change line_terminator (with an underscore), correct it to lineterminator.

 

apathetichell
20 - Arcturus

find out what version of python/pandas/alteryx is running on server. updates/downgrade version to the same locally. test your workflow. troubleshoot. fix. put back on server.

 

Any time you upgrade Server --- if the internal version of Python is changing -- you should perform migration tests on every single in production workflow which touches Python  prior to the upgrade. This is standard practice.

dreldrel
8 - Asteroid

It may be the reason for the version of the Python tool. Try dropping the old Python tool and validating your code on the new Python tool. If this helps, please feel free to like the comment

T-Ishii
6 - Meteoroid

Thank you, everyone!

I believe the issue was most likely caused by a change in the Python version, which affected the keyword variables.
I’d like to try correcting the variable name used in the macro.


That said, I apologize for the basic question, but could you please tell me how to modify a macro(yxmc)?
As shown in the attached image, is it correct to open the macro from Designer, edit the code, and then save it to overwrite the existing one?

Or, will it be necessary to reinstall it, just like with the standard Alteryx tools?

(This workflow does not appear to be one that comes pre-installed with Alteryx by default, but rather one that was created separately.)

 

This workflow isn’t something I can easily edit or run, so I hope you understand that I’m asking before trying it myself.
Thank you very much for your understanding.

apathetichell
20 - Arcturus

@T-Ishii so this is where Alteryx does not shine. Yes ---> you can edit the macro. save the macro. redeploy to server -- with a new package --- and that should work. but--- let's say you use this macro in many different workflows. It will not update. It will update it only in the new .yxzp which you are manually creating now --- it will not update it in every .yxzp which uses that macro.

 

This is where you get DevOps and Alteryx --- and that's pretty much a DIY thing which each company does differently...

KGT
13 - Pulsar

As mentioned by @apathetichell, if you just download the workflow with the macro in it as a dependency, change the text, then save back, it's just that one instance that will change.

 

As to doing it "properly" (quotes as Alteryx doesn't really specify what "properly" means), that depends on how your server etc is set up.

 

In an ideal world, your company/team would have a centralised Macro Repository and then the workflows would reference that, but many times Alteryx Servers are set up and those processes not added.

 

If you do have a Macro repository set up, then you would need to access that and open the macro, edit and save. However, that will change it for every person using that macro from that macro repository.

 

The question is, is this macro centralised and used across workflows, or is it a dependency for just this workflow?

T-Ishii
6 - Meteoroid

Thank you for your response! Thanks to your explanation, I was able to understand the issue.

 

Fortunately, the macro I'm using this time is only used in a single workflow, so it doesn't seem to affect any others.

Therefore, I’ll first try updating the macro using the method you suggested above.

 

I really appreciate everyone's quick response, thank you so much!

Labels
Top Solution Authors