-
Notifications
You must be signed in to change notification settings - Fork 400
Feat/3316 add mermaid diagram export to schema #3323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/3316 add mermaid diagram export to schema #3323
Conversation
|
@zilto I seem to have steered away from regular parameters a bit in the implementation.
|
zilto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is almost there! There are few things to align with existing to_dot() and to_dbml() for consistency and some unit tests to add
dlt/helpers/mermaid.py
Outdated
| return "".join(items) | ||
|
|
||
|
|
||
| def _columns_to_text(columns: TTableSchemaColumns) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's worth having a _to_mermaid_column() function that generates a single column. Then we have:
_to_mermaid_column()_to_mermaid_table()_to_mermaid_reference()schema_to_mermaid()
Then, add unit tests to this function to check if it produces the expected results for:
- no hint
- each individual hint
- 2+ hints
Additional argI think it would be useful to have a top-level arg |
|
hey @zilto almost done with the feedback you provided (thanks for that) one question, at the moment when we include all the dlt tables the _dlt_version renders separately
though the version is populated by every table should it be any different? things pending
|
|
closing in favor of #3364 |

Description
Adding capability to generate mermaid diagrams from schema, the representation in mermaid includes the following
Related Issues
dlt.Schema.to_mermaid()#3316Additional Context
Task List