Created
October 2, 2019 22:00
-
-
Save talagluck/461849ed9392b09863a018146693d517 to your computer and use it in GitHub Desktop.
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
from great_expectations.render.renderer import ( | |
ExpectationSuitePageRenderer | |
) | |
from great_expectations.render.types import ( | |
RenderedDocumentContent, | |
RenderedSectionContent, | |
RenderedComponentContent, | |
) | |
class MyCustomExpectationSuitePageRenderer(ExpectationSuitePageRenderer): | |
def render(self, expectations): | |
rendered_document_content = super().render(expectations) | |
content_blocks = [ | |
self._render_data_dictionary_header(expectations), | |
] | |
rendered_document_content["sections"] = [ | |
RenderedSectionContent(**{ | |
"section_name": "Hello World!!", | |
"content_blocks": content_blocks | |
}) | |
] + rendered_document_content["sections"] | |
return rendered_document_content | |
def _render_data_dictionary_header(self, expectations): | |
return RenderedComponentContent(**{ | |
"content_block_type": "header", | |
"header": "hello world", | |
"styling": { | |
"classes": ["col-12"], | |
"header": { | |
"classes": ["alert", "alert-secondary"] | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment