Skip to content

Correct typos, change default output extensions and replace invalid characters from node name - #2

Open
ghost wants to merge 3 commits into
nabsabraham:masterfrom
b-a0:master
Open

Correct typos, change default output extensions and replace invalid characters from node name#2
ghost wants to merge 3 commits into
nabsabraham:masterfrom
b-a0:master

Conversation

@ghost

@ghost ghost commented Oct 13, 2021

Copy link
Copy Markdown

No description provided.

ba-tno added 3 commits October 13, 2021 17:55
Typo in concentrate option, semi-colons are not accepted in brackets, default extension for grapvhiz files is .gv or .dot.
Grapvhiz does not like dashes in node names, therefore I replace them with underscores
Comment thread pandaserd/module.py


def write_to_file(self, filename='output.txt'):
def write_to_file(self, filename='output.gv'):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was using the output.txt to paste into a graphviz renderer. is this change so that you can just render it locally?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I cannot recall why I made this change specifically. Probably because .gv is a standard extension for Grapvhiz DOT files. Likely I was using another tool that would pick up .gv files and render them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, .gv is the correct Graphviz DOT files. Graphviz is imported, but not sure if it's on the build yet...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the output is saved as a .gv file, graphviz library can be used to display it on the screen if using a notebook and can also be used to save it, as a png in this example.

...
raw_entity_relationship_diagram.write_to_file('raw_entity_relationship_diagram.gv')
graph = graphviz.Source.from_file('raw_entity_relationship_diagram.gv')
graph.render('erd_raw', format='png') #Save file
display(graph)

Comment thread pandaserd/module.py
table_end = '\t\t' + '</table>>];'
self.table_def.append(self.front_matter)
for col, col_type in self.meta_info:
col = col.replace("-", "_")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAHAHA! Someone has been playing with AWS Athena, @ba-tno ? ;)

Comment thread pandaserd/module.py
fontname="Helvetica";
nodesep=0.5,
rankdir="LR",
concentrate=true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants