great_expectations.render.renderer.site_builder

Module Contents

Classes

SiteBuilder(data_context, store_backend, site_name=None, site_index_builder=None, show_how_to_buttons=True, site_section_builders=None, runtime_environment=None, **kwargs)

SiteBuilder builds data documentation for the project defined by a

DefaultSiteSectionBuilder(name, data_context, target_store, source_store_name, custom_styles_directory=None, custom_views_directory=None, show_how_to_buttons=True, run_name_filter=None, validation_results_limit=None, renderer=None, view=None, data_context_id=None, **kwargs)

DefaultSiteIndexBuilder(name, site_name, data_context, target_store, custom_styles_directory=None, custom_views_directory=None, show_how_to_buttons=True, validation_results_limit=None, renderer=None, view=None, data_context_id=None, source_stores=None, **kwargs)

CallToActionButton(title, link)

great_expectations.render.renderer.site_builder.logger
class great_expectations.render.renderer.site_builder.SiteBuilder(data_context, store_backend, site_name=None, site_index_builder=None, show_how_to_buttons=True, site_section_builders=None, runtime_environment=None, **kwargs)

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: TupleS3StoreBackend
        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: TupleS3StoreBackend
        bucket: data_docs.my_company.com
        prefix: /data_docs/
    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
clean_site(self)
build(self, 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 forthe 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

get_resource_url(self, resource_identifier=None, only_if_exists=True)

Return the URL of the HTML document that renders a resource (e.g., an expectation suite or a validation result).

Parameters

resource_identifier – ExpectationSuiteIdentifier,

ValidationResultIdentifier or any other type’s identifier. The argument is optional - whennot supplied, the method returns the URL of the index page. :return: URL (string)

class great_expectations.render.renderer.site_builder.DefaultSiteSectionBuilder(name, data_context, target_store, source_store_name, custom_styles_directory=None, custom_views_directory=None, show_how_to_buttons=True, run_name_filter=None, validation_results_limit=None, renderer=None, view=None, data_context_id=None, **kwargs)

Bases: object

build(self, resource_identifiers=None)
_resource_key_passes_run_name_filter(self, resource_key)
class great_expectations.render.renderer.site_builder.DefaultSiteIndexBuilder(name, site_name, data_context, target_store, custom_styles_directory=None, custom_views_directory=None, show_how_to_buttons=True, validation_results_limit=None, renderer=None, view=None, data_context_id=None, source_stores=None, **kwargs)

Bases: object

get_calls_to_action(self)
_get_call_to_action_buttons(self, usage_statistics)

Build project and user specific calls to action buttons.

This can become progressively smarter about project and user specific calls to action.

build(self)
class great_expectations.render.renderer.site_builder.CallToActionButton(title, link)

Bases: object