-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs as a real node config and support
node_color
for coloring …
…the DAG (#5397) * add Optional node_color config in Docs dataclass * Remove node_color from the original docs config * Add docs config and input validation * Handle when docs is both under docs and config.docs * Add node_color to Docs * Make docs a Dict to avoid parsing errors * Make docs a dataclass instead of a Dict * Fix error when using docs as dataclass * Simplify generator for the default value * skeleton for test fixtures * bump manifest to v7 * + config hierarchy tests * add show override tests * update manifest * Remove node_color from the original docs config * Add node_color to Docs * Make docs a Dict to avoid parsing errors * Make docs a dataclass instead of a Dict * Simplify generator for the default value * + config hierarchy tests * add show override tests * Fix unit tests * Add tests in case of incorrect input for node_color * Rename tests and Fix typos * Fix functional tests * Fix issues with remote branch * Add changie entry * modify tests to meet standards (#5608) Co-authored-by: Matt Winkler <[email protected]> Co-authored-by: Emily Rockman <[email protected]>
- Loading branch information
1 parent
7886924
commit 32415e3
Showing
14 changed files
with
7,058 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: Features | ||
body: Make `docs` configurable in `dbt_project.yml` and add a `node_color` attribute | ||
to change the color of nodes in the DAG | ||
time: 2022-08-03T10:42:30.60624+02:00 | ||
custom: | ||
Author: matt-winkler sungchun12 b-per | ||
Issue: "5333" | ||
PR: "5397" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
import re | ||
|
||
HTML_COLORS = [ | ||
"aliceblue", | ||
"antiquewhite", | ||
"aqua", | ||
"aquamarine", | ||
"azure", | ||
"beige", | ||
"bisque", | ||
"black", | ||
"blanchedalmond", | ||
"blue", | ||
"blueviolet", | ||
"brown", | ||
"burlywood", | ||
"cadetblue", | ||
"chartreuse", | ||
"chocolate", | ||
"coral", | ||
"cornflowerblue", | ||
"cornsilk", | ||
"crimson", | ||
"cyan", | ||
"darkblue", | ||
"darkcyan", | ||
"darkgoldenrod", | ||
"darkgray", | ||
"darkgreen", | ||
"darkkhaki", | ||
"darkmagenta", | ||
"darkolivegreen", | ||
"darkorange", | ||
"darkorchid", | ||
"darkred", | ||
"darksalmon", | ||
"darkseagreen", | ||
"darkslateblue", | ||
"darkslategray", | ||
"darkturquoise", | ||
"darkviolet", | ||
"deeppink", | ||
"deepskyblue", | ||
"dimgray", | ||
"dodgerblue", | ||
"firebrick", | ||
"floralwhite", | ||
"forestgreen", | ||
"fuchsia", | ||
"gainsboro", | ||
"ghostwhite", | ||
"gold", | ||
"goldenrod", | ||
"gray", | ||
"green", | ||
"greenyellow", | ||
"honeydew", | ||
"hotpink", | ||
"indianred", | ||
"indigo", | ||
"ivory", | ||
"khaki", | ||
"lavender", | ||
"lavenderblush", | ||
"lawngreen", | ||
"lemonchiffon", | ||
"lightblue", | ||
"lightcoral", | ||
"lightcyan", | ||
"lightgoldenrodyellow", | ||
"lightgray", | ||
"lightgreen", | ||
"lightpink", | ||
"lightsalmon", | ||
"lightsalmon", | ||
"lightseagreen", | ||
"lightskyblue", | ||
"lightslategray", | ||
"lightsteelblue", | ||
"lightyellow", | ||
"lime", | ||
"limegreen", | ||
"linen", | ||
"magenta", | ||
"maroon", | ||
"mediumaquamarine", | ||
"mediumblue", | ||
"mediumorchid", | ||
"mediumpurple", | ||
"mediumseagreen", | ||
"mediumslateblue", | ||
"mediumslateblue", | ||
"mediumspringgreen", | ||
"mediumturquoise", | ||
"mediumvioletred", | ||
"midnightblue", | ||
"mintcream", | ||
"mistyrose", | ||
"moccasin", | ||
"navajowhite", | ||
"navy", | ||
"oldlace", | ||
"olive", | ||
"olivedrab", | ||
"orange", | ||
"orangered", | ||
"orchid", | ||
"palegoldenrod", | ||
"palegreen", | ||
"paleturquoise", | ||
"palevioletred", | ||
"papayawhip", | ||
"peachpuff", | ||
"peru", | ||
"pink", | ||
"plum", | ||
"powderblue", | ||
"purple", | ||
"rebeccapurple", | ||
"red", | ||
"rosybrown", | ||
"royalblue", | ||
"saddlebrown", | ||
"salmon", | ||
"sandybrown", | ||
"seagreen", | ||
"seashell", | ||
"sienna", | ||
"silver", | ||
"skyblue", | ||
"slateblue", | ||
"slategray", | ||
"snow", | ||
"springgreen", | ||
"steelblue", | ||
"tan", | ||
"teal", | ||
"thistle", | ||
"tomato", | ||
"turquoise", | ||
"violet", | ||
"wheat", | ||
"white", | ||
"whitesmoke", | ||
"yellow", | ||
"yellowgreen", | ||
] | ||
|
||
|
||
def validate_color(color: str) -> bool: | ||
match_hex = re.search(r"^#(?:[0-9a-f]{3}){1,2}$", color.lower()) | ||
match_html_color_name = color.lower() in HTML_COLORS | ||
return bool(match_hex or match_html_color_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.