简体   繁体   English

Synapse Pipeline Notebook 无法从引用的 Notebook 中解析方法

[英]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.

相关问题 无法列出 Synapse 笔记本中的 blob - Cant list blobs from Synapse notebook Azure Synapse Pipeline Notebook 返回错误 - Azure Synapse Pipeline Notebook Return Error 使用帐户密钥从 Synapse Notebook 写入 ADLS - Writing to ADLS from Synapse Notebook with account key azure 突触中 spark notebook 管道中的文件路径错误 - File path error in pipeline for spark notebook in azure synapse 从 Azure Synapse Notebook 访问 S3 文件 - Access S3 files from Azure Synapse Notebook Azure Synapse:可以从 Synapse Notebook 创建/部署 ONNX model 到专用 sql 池吗? - Azure Synapse: Possible to create/deploy ONNX model to dedicated sql pool from Synapse Notebook? Azure Synapse Notebook 对认知服务翻译器的请求 - Azure Synapse Notebook request to Cognitive services translator 如何使用 Azure Synapse 和 pySpark 笔记本从 ADLS gen2 检索 .dcm 图像文件? - How to retrieve .dcm image files from the ADLS gen2 using Azure Synapse and pySpark notebook? 从 Azure Datafactory 管道中的 Databricks Notebook 获取异常 - Get exceptions from Databricks Notebook in Azure Datafactory pipeline TypeError:函数()参数“代码”必须是代码,而不是 Azure Synapse Notebook 中的 str - TypeError: function() argument 'code' must be code, not str in Azure Synapse Notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM