Azure Synapse Pipeline Notebook 返回错误

问题描述

我想在 Azure Synapse 上创建管道,其中一个流程是使用 notebook 读取、验证然后继续管道或停止管道

if(validation=True): #success on validation
   return df #continue the pipeline
if(validation=False): #Failed on validation
   return error #stop the pipeline

我已经在 stackoverflow 和 google 上进行了研究,但是我找不到具体的方法。我已经尝试过 break 和 mssparkutils.notebook.exit 但它不起作用

解决方法

已经解决了。你可以这样做

if validations==True:
   print(df)
else:
   raise TypeError('Validation failed')