Alteryx Designer Discussions

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

Python Tool throws RuntimeError on if there are no rows

6 - Meteoroid

The Python Tool is throwing a RuntimeError if a input table to the function contains no rows.


The error shown is:

Error: unable to read input table "4460abb7be83bae8f01b9bf1238a923c" (C:\Users\...


I've created a workaround by inputting the column names separately, catching the error, and exporting an empty Pandas DataFrame, but the function should handle tables with no rows by creating an empty Pandas DataFrame directly.


The implementation is part of a Macro and I can't guarantee they will always be rows received.


Had anyone else encountered this problem?


Hello @braggis ,

I experience an error when no data is passed to the python tool.

As another workaround, you can add a record count with the RecordCount tool with an AppendField to be sure that you push every time a data frame with values inside.


(If this post helps, then please consider Accept it as the solution to help the other members find it more quickly).



17 - Castor
17 - Castor

Hi @WilliamR 


cc: @BlytheE 


I battled with this exact error today too!


Is there a fix on the roadmap for this?   It seems like the desired behavior would be for the Alteryx.Read to return a dataframe with columns but no rows rather than throwing an error that cannot be managed?


it is possible to put the'#1') into a try-except block - but if it throws an error you just don't know if the error was caused by a missing connection; a failure of the Alteryx library or an empty record-set (which should not be a terminal error condition)!    Doesn't make sense for every user to have to work around this by putting a count tool in front of every python tool just to make sure it doesn't fail because of an empty recordset coming into the input.


If it helps - I'm happy to log an idea for this?


Thanks @WilliamR 



17 - Castor
17 - Castor

Hey Alteryx team, no updates on this? I agree with @SeanAdams it makes no sense at all

8 - Asteroid

Hi, checking to see if there was any update on this? Facing the same issue. A fix for this will be great! Thanks.

15 - Aurora

Hi, just to share the simple workaround that is working for me until this is fixed, i am uniting a text input with null data and filtering out this row inside the python tool.