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

render_graph() has hidden dependencies

Đang mở
#189 1 bình luận 3 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
299
Fork
84
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với tài liệu về Workflow.render_graph() và các phần README được liên kết trong issue, sau đó kiểm tra WorkflowGraphWidget và phương thức show() của nó. Xác định những hạn chế về IPython, notebook, JavaScript, CSS và khả năng chuyển đổi cần được ghi lại hoặc xử lý; công việc được xem là hoàn tất khi các môi trường được hỗ trợ và các dependency được nêu rõ, hoặc khi một phương án rendering cụ thể đã được thống nhất và triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
aws, jupyter, jupyter-notebook, python
Lĩnh vực
cloud, developer-experience, documentation
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.