I have a Synapse Pipeline which runs a notebook containing unit tests before executing the business job (another notebook). 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. 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. 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.
I tried using the magic %run
command instead of mssparkutils.notebook.run()
to no avail.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.