Skip to content

Instantly share code, notes, and snippets.

@talagluck
Created October 2, 2019 22:00
Show Gist options
  • Save talagluck/461849ed9392b09863a018146693d517 to your computer and use it in GitHub Desktop.
Save talagluck/461849ed9392b09863a018146693d517 to your computer and use it in GitHub Desktop.
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