This macro pushes hyper files to our Tableau server. If I enter the values directly into the text in put tool and run the macro as a normal workflow it works fine.
HOWEVER, when I put the macro in a workflow and enter the values in the questions panel it throws this error
Error: Publish to Tableau - Python (1): Tool #9: ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2888 try:
-> 2889 return self._engine.get_loc(casted_key)
2890 except KeyError as err:
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'FilePath'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
<ipython-input-3-5b6fa79fd78e> in <module>
14
15 # Extract the values from the dataframe and modify strings as needed
---> 16 file_path = df.at[0, 'FilePath']
17 if not file_path.endswith("\\"):
18 file_path += "\\" #add a backslash to the end of string if none exists
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\indexing.py in __getitem__(self, key)
2078 return self.obj.loc[key]
2079
-> 2080 return super().__getitem__(key)
2081
2082 def __setitem__(self, key, value):
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\indexing.py in __getitem__(self, key)
2025
2026 key = self._convert_key(key)
-> 2027 return self.obj._get_value(*key, takeable=self._takeable)
2028
2029 def __setitem__(self, key, value):
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\frame.py in _get_value(self, index, col, takeable)
3001 return series._values[index]
3002
-> 3003 series = self._get_item_cache(col)
3004 engine = self.index._engine
3005
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\generic.py in _get_item_cache(self, item)
3529 # pending resolution of GH#33047
3530
-> 3531 loc = self.columns.get_loc(item)
3532 values = self._mgr.iget(loc)
3533 res = self._box_col_values(values, loc)
c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2889 return self._engine.get_loc(casted_key)
2890 except KeyError as err:
-> 2891 raise KeyError(key) from err
2892
2893 if tolerance is not None:
KeyError: 'FilePath'Why would the python work standalone, but not as a macro?