Python Data Function (PyDF) failed to create DataTable

Hi there,

I'm trying to include Python code running no problem in Spyder into a Spotfire analysis. It's a bit of a lengthy code but at the end of the day it produces two pandas DataFrames. The code itself runs fine also in Spotfire but as soon as I try to make one of the pandas DataFrames an output using the output handler "Data table" I get the following error:

Could not execute function call 'Python Script DataFunction'

Failed to create DataTable

   at Spotfire.Dxp.Data.ColumnFactory.CreateColumns(DataRowReader reader, String documentTitle, IDataPropertyContainer properties, GlobalMethodRegistry globalMethodRegistry, CxxSession session, Boolean addNewProperties, PartialDataLoadReport report, Func`2 resultPropertiesCreator, UInt64 maxRowsToConsume)

   at Spotfire.Dxp.Data.ColumnFactory.CreateColumns(DataRowReader reader, String documentTitle, IDataPropertyContainer properties, DataPropertyRegistry propertyRegistry, GlobalMethodRegistry globalMethodRegistry, CxxSession session, Boolean addNewProperties, PartialDataLoadReport report, ResultProperties resultProperties)

   at Spotfire.Dxp.Data.DataFunctions.DataFunctionImpl.DataFunctionWorkItemState.Convert(DataRowReader reader, DataManager dataManager, Boolean mangleNames)

   at Spotfire.Dxp.Data.DataFunctions.DataFunctionImpl.DataFunctionWorkItemState.GetOutputResults(Boolean withoutTransformations)

   at Spotfire.Dxp.Data.DataFunctions.DataFunctionImpl.DataFunctionWorkItemState.<>c__DisplayClass81_0.<ExecuteFunction>b__1()

   at Spotfire.Dxp.Framework.ApplicationModel.Progress.ExecuteSubtask(String title, ProgressOperation operation)

   at Spotfire.Dxp.Data.DataFunctions.DataFunctionImpl.DataFunctionWorkItemState.ExecuteFunction(Boolean withoutTransformations)

I assume it is something very simple but could only find articles related to IronPyton but not to PyDF. An idea on what might be the issue would be highly appreciated!

I'm using Spotfire 10.3.1, Python 3.6.4 and we have SpotfirePS.DataFunctions.Python(Forms) 1.2.1.0 deployed.

Thanks,

Mark

1 Comment

Had a long WebEx with Tibco support yesterday and it turns out that in my case the problem was that the pandas dataframe contained one column of type int32. Deleting that column allows to create the table. I assuem changing it to int64 would as well since there are multiple other columns of type int64 creating no issues.

Tibco will update their SpotfirePS.DataFunctions.Python to deal with the issue.

Thanks!

Mark

mark.herrmann2 - Jul 30, 2019 - 2:08am
+ Add a Comment

(1) Answer

Login