Free Trial

Alteryx Designer Desktop Discussions

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

Question&Problem -> Python Tool : Cannot write Output data from tool

kantawee
7 - Meteor

Python Tool : I cannot write Output data from tool.

 

My Variable type is pandas data frames, but cannot write output? !!!

 

How to config this problem? please, help T^T

 

 

Python_WriteError.PNGPython_WriteError1.PNG

 

 

Error MSG
""

Error: Python (1): [NbConvertApp] Converting notebook C:\Users\User\AppData\Local\Temp\17cfdbd9-ec9b-4afd-b81e-053557665be6\1\workbook.ipynb to html
[NbConvertApp] Executing notebook with kernel: python3
2018-09-18 15:30:26.755508: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
[NbConvertApp] ERROR | Error while converting 'C:\Users\User\AppData\Local\Temp\17cfdbd9-ec9b-4afd-b81e-053557665be6\1\workbook.ipynb'
Traceback (most recent call last):
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 393, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 174, in from_filename
return self.from_file(f, resources=resources, **kw)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 192, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\html.py", line 85, in from_notebook_node
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\templateexporter.py", line 280, in from_notebook_node
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 134, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 311, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\base.py", line 47, in __call__
return self.preprocess(nb, resources)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 262, in preprocess
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\base.py", line 69, in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
File "d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 286, in preprocess_cell
raise CellExecutionError.from_cell_and_msg(cell, out)
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
Alteryx.write(tokenResult2,1)
------------------

---------------------------------------------------------------------------
InterfaceError Traceback (most recent call last)
<ipython-input-4-49de8691a69c> in <module>()
----> 1 Alteryx.write(tokenResult2,1)

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\ayx\export.py in write(pandas_df, outgoing_connection_number)
21 When running the workflow in Alteryx, this function will convert a pandas data frame to an Alteryx data stream and pass it out through one of the tool's five output anchors. When called from the Jupyter notebook interactively, it will display a preview of the pandas dataframe.
22 '''
---> 23 return __CachedData__().write(pandas_df, outgoing_connection_number)
24 
25 def getIncomingConnectionNames():

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\ayx\CachedData.py in write(self, pandas_df, outgoing_connection_number)
330 try:
331 # get the data from the sql db (if only one table exists, no need to specify the table name)
--> 332 data = db.writeData(pandas_df, 'data')
333 # print success message
334 print(''.join(['SUCCESS: ', msg_action]))

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\ayx\CachedData.py in writeData(self, pandas_df, table)
170 print('Attempting to write data to table "{}"'.format(table))
171 try:
--> 172 pandas_df.to_sql(table, self.connection, if_exists='replace', index=False)
173 if self.debug:
174 print(fileErrorMsg(

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\pandas\core\generic.py in to_sql(self, name, con, schema, if_exists, index, index_label, chunksize, dtype)
2128 sql.to_sql(self, name, con, schema=schema, if_exists=if_exists,
2129 index=index, index_label=index_label, chunksize=chunksize,
-> 2130 dtype=dtype)
2131 
2132 def to_pickle(self, path, compression='infer',

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\pandas\io\sql.py in to_sql(frame, name, con, schema, if_exists, index, index_label, chunksize, dtype)
448 pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index,
449 index_label=index_label, schema=schema,
--> 450 chunksize=chunksize, dtype=dtype)
451 
452

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\pandas\io\sql.py in to_sql(self, frame, name, if_exists, index, index_label, schema, chunksize, dtype)
1479 dtype=dtype)
1480 table.create()
-> 1481 table.insert(chunksize)
1482 
1483 def has_table(self, name, schema=None):

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\pandas\io\sql.py in insert(self, chunksize)
639 
640 chunk_iter = zip(*[arr[start_i:end_i] for arr in data_list])
--> 641 self._execute_insert(conn, keys, chunk_iter)
642 
643 def _query_iterator(self, result, chunksize, columns, coerce_float=True,

d:\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\pandas\io\sql.py in _execute_insert(self, conn, keys, data_iter)
1268 def _execute_insert(self, conn, keys, data_iter):
1269 data_list = list(data_iter)
-> 1270 conn.executemany(self.insert_statement(), data_list)
1271 
1272 def _create_table_setup(self):

InterfaceError: Error binding parameter 0 - probably unsupported type.
InterfaceError: Error binding parameter 0 - probably unsupported type.

 ""

21 REPLIES 21
G1
8 - Asteroid

@PaulNthank you for your explanation and for the additional pointers. I have made notes 🙂🙂

 

 

mwu1254
5 - Atom

I just encountered this issue and it turns out that somehow my column names are numeric instead of strings, when changed to string, I can write to output again.

Labels
Top Solution Authors