aws / aws/aws-step-functions-data-science-sdk-python

render_graph() has hidden dependencies

未关闭
#189 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
299
派生
84
PR 合并指标
30 天内没有已合并 PR

描述

render_graph() is improperly documented and is not portable

### Use Case

Better support for render_graph() allows not just exploration through notebooks, it enables real production software projects. It provides feedback that doesn't require deployment in the AWS Console or through an automated deployment pipeline. It helps with documentation and code reviews.

It's a highly valuable tool in the SDK that only works in a notebook.

### Proposed Solution

Update the docs:

- https://aws-step-functions-data-science-sdk.readthedocs.io/en/stable/workflow.html#stepfunctions.workflow.Workflow.render_graph
- https://aws-step-functions-data-science-sdk.readthedocs.io/en/stable/readmelink.html#visualizing-a-workflow

The second link says it doesn't work in JupyterLab but it doesn't explicitly say that it only works in Jupyter Notebooks. I believe SageMaker and EMR Notebooks both use JupyterLab at this point.

If nothing is going to be done, this implementation should at least be deprecated because it's so selectively useful and is a red herring for people looking for this functionality.

### Other

The current render_graph() method provides very unclear documentation. There is no mention of the Ipython requirement and the logs warning the user can easily be silenced without them ever knowing.

If you try to dig into the render_graph() method, you'll find the WorkflowGraphWidget and the show() method that generates some HTML object for IPython. In order to get something potentially useful, I checked out the "data" attribute of the HTML that was generated and found a CSS link and a JS script tag and a div with an svg tag. It appears that the widget generates the html containing javascript to generate the definition.

This could be much better. For one, the docs need to be updated to reflect the dependencies.

For actual rendering, you could:
- Use an explicitly imported Python library
- Generate HTML that works outside of IPython
- Add a function in Boto3 to fetch the image URL or bytes
- Add a publicly accessible endpoint that accepts the definition JSON

* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change

---

This is a :rocket: Feature Request

贡献指南

打开贡献指南

调研方向

先阅读 Workflow.render_graph() 文档以及 issue 中链接的 README 部分,然后检查 WorkflowGraphWidget 及其 show() 方法。确定哪些 IPython、notebook、JavaScript、CSS 和可移植性限制需要记录或处理;当明确说明所支持的环境和依赖项,或确定并实现了具体的渲染方案时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, jupyter, jupyter-notebook, python
领域
cloud, developer-experience, documentation
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
28/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。