简体   繁体   English

Databricks 如何通过 API 获取 Notebook Jobs 的 output?

[英]Databricks how to get output of the Notebook Jobs via API?

My Python Notebooks log some data into stdout and when I run this notebooks via UI I can see outputs inside cell.我的 Python 笔记本将一些数据记录到标准输出中,当我通过 UI 运行此笔记本时,我可以在单元格内看到输出。

Now I am running Python Notebooks on Databricks via API ( /2.1/jobs/create and then /2.1/jobs/run-now ) and would like to get output. I tried both /2.1/jobs/runs/get and /2.1/jobs/runs/get-output however none of the includes stdout of the Notebook.现在,我正在通过 API( /2.1/jobs/create然后/2.1/jobs/run-now )在 Databricks 上运行 Python Notebooks,并希望获得 output。我尝试了/2.1/jobs/runs/get/2.1/jobs/runs/get-output但是没有一个包含 Notebook 的标准输出。

Is there any way to access stdour of the Notebook via API?有什么方法可以通过 API 访问笔记本的 stdour 吗?

PS I am aware of dbutils.notebook.exit() and will use it, if it will not be possible to get stdout. PS 我知道 dbutils.notebook.exit() 并将使用它,如果无法获得标准输出。

Yes, it is impossible to get the default return from python code.是的,从python代码获取默认返回是不可能的。 I saw that on a different cloud provider you can get an output from logs also.我看到在不同的云提供商上,您也可以从日志中获得 output。 100% solution it is using dbutils.notebook.exit() 100% 的解决方案是使用dbutils.notebook.exit()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM