alteryx - Alteryx 无法从数据框写入 SQL/excel
问题描述
我创建了一个 Alteryx 工作流程,在其中运行代码在 python 笔记本中从 Web API 中提取数据,将 API 提取的输出存储为数据帧,并尝试通过锚 1 将其写入 excel 文件。当我收到以下错误时我运行了工作流程:
FileNotFoundError:缓存数据不可用 - 运行工作流以使输入数据在 Jupyter 笔记本 (.\Alteryx_Automation\dsd_runner\jupyterPipes.json) 中可用
我对 Alteryx 很陌生,如果有任何指导/建议,我将不胜感激
Here is code that replicates the error and has similar structure to what I have in my notebook
``from ayx import Alteryx
class DataExtract():
def __init__(self):
self.url = 'https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/owid-covid-data.csv'
self.data = dict()
def get_data(self):
self.data['owid'] = pd.read_csv(self.url)
de = DataExtract()
de.get_data()
temp = de.data['owid']
Alteryx.write(temp,1)``
解决方案
解决了这个问题,我在 python 笔记本中发出了一个 os.chdir() 命令,我的工作目录被更改为我没有写权限的目录。通过跟踪当前目录( orig_dir = os.getcwd() )然后在脚本末尾发出 os.chdir(orig_dir) 来解决它。此外,制作类属性的深层副本也有助于解决问题。
推荐阅读
- postgresql - 如何解决:AND 的参数必须是布尔类型,而不是数字类型
- javascript - 从另一个活动执行功能
- jquery - 计算一个元素的总 scrollTop 和 scrollLeft
- python - 拆分汇总数据并重新汇总
- kotlin - Kotlin 类 ProtoBuf$EnumEntryOrBuilder 的间歇性 NoClassDefFoundError
- c# - 有没有办法在 Win Forms Application 的图表中将 X 坐标和其他数据放在 Y 坐标上
- angular - 具有自定义域的 lambda api 网关上的无服务器 Angular 7 项目
- angular - 替换 ag-grid 上节点模块上的 typescript 类
- quickblox - 在android中构建问题
- python - 我错过了什么?