[英]Synapse Pipeline Notebook cant resolve method from referenced Notebook
I have a Synapse Pipeline which runs a notebook containing unit tests before executing the business job (another notebook).我有一个 Synapse 管道,它在执行业务作业(另一个笔记本)之前运行一个包含单元测试的笔记本。 The unit test notebook references the functions using the
mssparkutils.notebook.run()
command, and works fine when I run the notebook on its own in Synapse Studio.单元测试笔记本使用
mssparkutils.notebook.run()
命令引用了这些函数,并且当我在 Synapse Studio 中自行运行笔记本时工作正常。 However, when I trigger the notebook in a pipeline, it fails with the error:但是,当我在管道中触发笔记本时,它会失败并出现错误:
{
"errorCode": "6002",
"message": "NameError: name 'get_latest_report_per_user' is not defined",
"failureType": "UserError",
"target": "Run Tests",
"details": []
}
get_latest_report_per_user
is defined in the referenced notebook. get_latest_report_per_user
在引用的笔记本中定义。 The reference works fine when run on its own outside of the pipeline.当在管道外部单独运行时,该参考工作正常。
The above snippet is from the unit test notebook I am running, and get_latest_report_per_user
is defined in the "dependency"
notebook.上面的代码片段来自我正在运行的单元测试笔记本,
get_latest_report_per_user
在"dependency"
笔记本中定义。
I tried using the magic %run
command instead of mssparkutils.notebook.run()
to no avail.我尝试使用魔术
%run
命令而不是mssparkutils.notebook.run()
无济于事。
Why is this only failing when executed as part of a pipeline?为什么这仅在作为管道的一部分执行时才会失败?
I've been having similar issues and some of them were resolved by "Publishing" the Notebooks.我一直有类似的问题,其中一些通过“发布”笔记本得到解决。 You could also try the "Enable unpublished notebook reference" option under Notebook properties, but I can't recall if this option is respected by Notebooks which are invoked by a Synapse Pipeline.
您还可以尝试笔记本属性下的“启用未发布的笔记本参考”选项,但我不记得该选项是否受到 Synapse 管道调用的笔记本的尊重。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.