Render

Renderer Module

class great_expectations.render.renderer.renderer.Renderer

Bases: object

classmethod render(ge_object)

Site Builder

class great_expectations.render.renderer.site_builder.SiteBuilder(data_context, store_backend, site_index_builder=None, site_section_builders=None, datasource_whitelist=None)

Bases: object

SiteBuilder builds data documentation for the project defined by a DataContext.

A data documentation site consists of HTML pages for expectation suites, profiling and validation results, and an index.html page that links to all the pages.

The exact behavior of SiteBuilder is controlled by configuration in the DataContext’s great_expectations.yml file.

Users can specify:

  • which datasources to document (by default, all)

  • whether to include expectations, validations and profiling results sections (by default, all)

  • where the expectations and validations should be read from (filesystem or S3)

  • where the HTML files should be written (filesystem or S3)

  • which renderer and view class should be used to render each section

Here is an example of a minimal configuration for a site:

local_site:
    class_name: SiteBuilder
    store_backend:
        class_name: FixedLengthTupleS3StoreBackend
        bucket: data_docs.my_company.com
        prefix: /data_docs/

A more verbose configuration can also control individual sections and override renderers, views, and stores:

local_site:
    class_name: SiteBuilder
    store_backend:
        class_name: FixedLengthTupleS3StoreBackend
        bucket: data_docs.my_company.com
        prefix: /data_docs/
    datasource_whitelist:
      - my_source
      - my_second_source
    site_index_builder:
        class_name: DefaultSiteIndexBuilder

    # Verbose version:
    # index_builder:
    #     module_name: great_expectations.render.builder
    #     class_name: DefaultSiteIndexBuilder
    #     renderer:
    #         module_name: great_expectations.render.renderer
    #         class_name: SiteIndexPageRenderer
    #     view:
    #         module_name: great_expectations.render.view
    #         class_name: DefaultJinjaIndexPageView

    site_section_builders:
        # Minimal specification
        expectations:
            class_name: DefaultSiteSectionBuilder
            source_store_name: expectation_store
        renderer:
            module_name: great_expectations.render.renderer
            class_name: ExpectationSuitePageRenderer

        # More verbose specification with optional arguments
        validations:
            module_name: great_expectations.data_context.render
            class_name: DefaultSiteSectionBuilder
            source_store_name: local_validation_store
            renderer:
                module_name: great_expectations.render.renderer
                class_name: SiteIndexPageRenderer
            view:
                module_name: great_expectations.render.view
                class_name: DefaultJinjaIndexPageView
build(resource_identifiers=None)
Parameters

resource_identifiers – a list of resource identifiers (ExpectationSuiteIdentifier, ValidationResultIdentifier). If specified, rebuild HTML (or other views the data docs site renders) only for the resources in this list. This supports incremental build of data docs sites (e.g., when a new validation result is created) and avoids full rebuild.

Returns

class great_expectations.render.renderer.site_builder.DefaultSiteSectionBuilder(name, data_context, target_store, source_store_name, run_id_filter=None, renderer=None, view=None)

Bases: object

build(datasource_whitelist, resource_identifiers=None)
class great_expectations.render.renderer.site_builder.DefaultSiteIndexBuilder(name, data_context, target_store, renderer=None, view=None)

Bases: object

build()

Page Renderers

Page Renderer

class great_expectations.render.renderer.page_renderer.ValidationResultsPageRenderer(column_section_renderer=None)

Bases: great_expectations.render.renderer.renderer.Renderer

render(validation_results={})
class great_expectations.render.renderer.page_renderer.ExpectationSuitePageRenderer(column_section_renderer=None)

Bases: great_expectations.render.renderer.renderer.Renderer

render(expectations)
class great_expectations.render.renderer.page_renderer.ProfilingResultsPageRenderer(overview_section_renderer=None, column_section_renderer=None)

Bases: great_expectations.render.renderer.renderer.Renderer

render(validation_results)

Site Index Page Renderer

class great_expectations.render.renderer.site_index_page_renderer.SiteIndexPageRenderer

Bases: great_expectations.render.renderer.renderer.Renderer

classmethod render(index_links_dict)

Section Renderers

Column Section Renderer

great_expectations.render.renderer.column_section_renderer.convert_to_string_and_escape(var)
class great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

Bases: great_expectations.render.renderer.renderer.Renderer

class great_expectations.render.renderer.column_section_renderer.ProfilingResultsColumnSectionRenderer(overview_table_renderer=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

render(evrs, section_name=None, column_type=None)
class great_expectations.render.renderer.column_section_renderer.ValidationResultsColumnSectionRenderer(table_renderer=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

render(validation_results={})
class great_expectations.render.renderer.column_section_renderer.ExpectationSuiteColumnSectionRenderer(bullet_list_renderer=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

render(expectations={})

Other Section Renderer

class great_expectations.render.renderer.other_section_renderer.ProfilingResultsOverviewSectionRenderer

Bases: great_expectations.render.renderer.renderer.Renderer

classmethod render(evrs, section_name=None)

Slack Renderer

class great_expectations.render.renderer.slack_renderer.SlackRenderer

Bases: great_expectations.render.renderer.renderer.Renderer

render(validation_json=None)

Content Blocks

class great_expectations.render.renderer.content_block.content_block.ContentBlockRenderer

Bases: great_expectations.render.renderer.renderer.Renderer

classmethod validate_input(render_object)
classmethod render(render_object, **kwargs)
classmethod list_available_expectations()
class great_expectations.render.renderer.content_block.bullet_list_content_block.ExpectationSuiteBulletListContentBlockRenderer

Bases: great_expectations.render.renderer.content_block.expectation_string.ExpectationStringRenderer

great_expectations.render.renderer.content_block.expectation_string.substitute_none_for_missing(kwargs, kwarg_list)

Utility function to plug Nones in when optional parameters are not specified in expectation kwargs.

Example

Input:

kwargs={“a”:1, “b”:2}, kwarg_list=[“c”, “d”]

Output: {“a”:1, “b”:2, “c”: None, “d”: None}

This is helpful for standardizing the input objects for rendering functions. The alternative is lots of awkward if “some_param” not in kwargs or kwargs[“some_param”] == None: clauses in renderers.

class great_expectations.render.renderer.content_block.expectation_string.ExpectationStringRenderer

Bases: great_expectations.render.renderer.content_block.content_block.ContentBlockRenderer

bar = '▁▂▃▄▅▆▇█'
barcount = 8
classmethod sparkline(weights)

Builds a unicode-text based sparkline for the provided histogram.

Code from https://rosettacode.org/wiki/Sparkline_in_unicode#Python

classmethod expect_column_to_exist(expectation, styling=None, include_column_name=True)
classmethod expect_column_unique_value_count_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_pair_values_A_to_be_greater_than_B(expectation, styling=None, include_column_name=True)
classmethod expect_column_pair_values_to_be_equal(expectation, styling=None, include_column_name=True)
classmethod expect_table_columns_to_match_ordered_list(expectation, styling=None, include_column_name=True)
classmethod expect_multicolumn_values_to_be_unique(expectation, styling=None, include_column_name=True)
classmethod expect_table_column_count_to_equal(expectation, styling=None, include_column_name=True)
classmethod expect_table_column_count_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_table_row_count_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_table_row_count_to_equal(expectation, styling=None, include_column_name=True)
classmethod expect_column_distinct_values_to_be_in_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_not_be_null(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_null(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_of_type(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_in_type_list(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_in_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_not_be_in_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_proportion_of_unique_values_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_increasing(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_decreasing(expectation, styling=None, include_column_name=True)
classmethod expect_column_value_lengths_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_value_lengths_to_equal(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_match_regex(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_not_match_regex(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_match_regex_list(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_not_match_regex_list(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_match_strftime_format(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_dateutil_parseable(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_json_parseable(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_match_json_schema(expectation, styling=None, include_column_name=True)
classmethod expect_column_distinct_values_to_contain_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_distinct_values_to_equal_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_mean_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_median_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_stdev_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_max_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_min_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_sum_to_be_between(expectation, styling=None, include_column_name=True)
classmethod expect_column_most_common_value_to_be_in_set(expectation, styling=None, include_column_name=True)
classmethod expect_column_kl_divergence_to_be_less_than(expectation, styling=None, include_column_name=True)
classmethod expect_column_values_to_be_unique(expectation, styling=None, include_column_name=True)
class great_expectations.render.renderer.content_block.profiling_overview_table_content_block.ProfilingOverviewTableContentBlockRenderer

Bases: great_expectations.render.renderer.content_block.content_block.ContentBlockRenderer

classmethod render(ge_object, header_row=[])

Each expectation method should return a list of rows

classmethod expect_column_values_to_not_match_regex(ge_object)
classmethod expect_column_unique_value_count_to_be_between(ge_object)
classmethod expect_column_proportion_of_unique_values_to_be_between(ge_object)
classmethod expect_column_max_to_be_between(ge_object)
classmethod expect_column_mean_to_be_between(ge_object)
classmethod expect_column_values_to_not_be_null(ge_object)
classmethod expect_column_values_to_be_null(ge_object)
class great_expectations.render.renderer.content_block.validation_results_table_content_block.ValidationResultsTableContentBlockRenderer

Bases: great_expectations.render.renderer.content_block.expectation_string.ExpectationStringRenderer

class great_expectations.render.renderer.content_block.exception_list_content_block.ExceptionListContentBlockRenderer

Bases: great_expectations.render.renderer.content_block.content_block.ContentBlockRenderer

Render a bullet list of exception messages raised for provided EVRs

View Module

class great_expectations.render.view.view.NoOpTemplate

Bases: object

render(document)
class great_expectations.render.view.view.PrettyPrintTemplate

Bases: object

render(document, indent=2)
class great_expectations.render.view.view.DefaultJinjaView(data_context=None)

Bases: object

Defines a method for converting a document to human-consumable form

  • Font Awesome 5.10.1

  • Bootstrap 4.3.1

  • jQuery 3.2.1

  • Vega 5.3.5

  • Vega-Lite 3.2.1

  • Vega-Embed 4.0.0

render(document, template=None, **kwargs)
render_content_block(context, content_block, index=None)
render_styling(styling)

Adds styling information suitable for an html tag.

Example styling block:

styling = {
    "classes": ["alert", "alert-warning"],
    "attributes": {
        "role": "alert",
        "data-toggle": "popover",
    },
    "styles" : {
        "padding" : "10px",
        "border-radius" : "2px",
    }
}

The above block returns a string similar to:

'class="alert alert-warning" role="alert" data-toggle="popover" style="padding: 10px; border-radius: 2px"'

“classes”, “attributes” and “styles” are all optional parameters. If they aren’t present, they simply won’t be rendered.

Other dictionary keys are also allowed and ignored.

render_styling_from_string_template(template)

This method is a thin wrapper use to call render_styling from within jinja templates.

render_string_template(template)
class great_expectations.render.view.view.DefaultJinjaPageView(data_context=None)

Bases: great_expectations.render.view.view.DefaultJinjaView

class great_expectations.render.view.view.DefaultJinjaIndexPageView(data_context=None)

Bases: great_expectations.render.view.view.DefaultJinjaPageView

class great_expectations.render.view.view.DefaultJinjaSectionView(data_context=None)

Bases: great_expectations.render.view.view.DefaultJinjaView

class great_expectations.render.view.view.DefaultJinjaComponentView(data_context=None)

Bases: great_expectations.render.view.view.DefaultJinjaView