great_expectations.jupyter_ux

Utility functions for working with great_expectations within jupyter notebooks or jupyter lab.

Package Contents

Classes

ExpectationSuiteColumnSectionRenderer(bullet_list_renderer=None)

ProfilingResultsColumnSectionRenderer(overview_table_renderer=None, expectation_string_renderer=None, runtime_environment=None)

ValidationResultsColumnSectionRenderer(table_renderer=None)

DefaultJinjaSectionView(custom_styles_directory=None, custom_views_directory=None)

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

Functions

set_data_source(context, data_source_type=None)

TODO: Needs a docstring and tests.

setup_notebook_logging(logger=None, log_level=logging.INFO)

Set up the provided logger for the GE default logging configuration.

show_available_data_asset_names(context, data_source_name=None)

List asset names found in the current context.

_render_for_jupyter(view, include_styling, return_without_displaying)

display_column_expectations_as_section(expectation_suite, column, include_styling=True, return_without_displaying=False)

This is a utility function to render all of the Expectations in an ExpectationSuite with the same column name as an HTML block.

display_profiled_column_evrs_as_section(evrs, column, include_styling=True, return_without_displaying=False)

This is a utility function to render all of the EVRs in an ExpectationSuite with the same column name as an HTML block.

display_column_evrs_as_section(evrs, column, include_styling=True, return_without_displaying=False)

Display validation results for a single column as a section.

class great_expectations.jupyter_ux.ExpectationSuiteColumnSectionRenderer(bullet_list_renderer=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

classmethod _render_header(cls, expectations)
_render_bullet_list(self, expectations)
render(self, expectations)
class great_expectations.jupyter_ux.ProfilingResultsColumnSectionRenderer(overview_table_renderer=None, expectation_string_renderer=None, runtime_environment=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

render(self, evrs, section_name=None, column_type=None)
classmethod _render_header(cls, evrs, column_type=None)
classmethod _render_expectation_types(cls, evrs, content_blocks)
_render_overview_table(self, evrs)
classmethod _render_quantile_table(cls, evrs)
classmethod _render_stats_table(cls, evrs)
classmethod _render_values_set(cls, evrs)
_render_histogram(self, evrs)
classmethod _render_bar_chart_table(cls, evrs)
classmethod _render_failed(cls, evrs)
classmethod _render_unrecognized(cls, evrs, content_blocks)
class great_expectations.jupyter_ux.ValidationResultsColumnSectionRenderer(table_renderer=None)

Bases: great_expectations.render.renderer.column_section_renderer.ColumnSectionRenderer

classmethod _render_header(cls, validation_results)
_render_table(self, validation_results)
render(self, validation_results)
class great_expectations.jupyter_ux.DefaultJinjaSectionView(custom_styles_directory=None, custom_views_directory=None)

Bases: great_expectations.render.view.view.DefaultJinjaView

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

  • Vega-Lite 4

  • Vega-Embed 6

_template = section.j2
_validate_document(self, document)
great_expectations.jupyter_ux.set_data_source(context, data_source_type=None)

TODO: Needs a docstring and tests.

great_expectations.jupyter_ux.setup_notebook_logging(logger=None, log_level=logging.INFO)

Set up the provided logger for the GE default logging configuration.

Parameters

- the logger to configure (logger) –

great_expectations.jupyter_ux.show_available_data_asset_names(context, data_source_name=None)

List asset names found in the current context.

great_expectations.jupyter_ux.cooltip_style_element = <style type="text/css">
.cooltip {

display:inline-block; position:relative; text-align:left;

}

.cooltip .top {

min-width:200px; top:-6px; left:50%; transform:translate(-50%, -100%); padding:10px 20px; color:#FFFFFF; background-color:#222222; font-weight:normal; font-size:13px; border-radius:8px; position:absolute; z-index:99999999; box-sizing:border-box; box-shadow:0 1px 8px rgba(0,0,0,0.5); display:none;

}

.cooltip:hover .top {

display:block;

}

.cooltip .top i {

position:absolute; top:100%; left:50%; margin-left:-12px; width:24px; height:12px; overflow:hidden;

}

.cooltip .top i::after {

content:’‘; position:absolute; width:12px; height:12px; left:50%; transform:translate(-50%,-50%) rotate(45deg); background-color:#222222; box-shadow:0 1px 8px rgba(0,0,0,0.5);

} </style>

great_expectations.jupyter_ux._render_for_jupyter(view, include_styling, return_without_displaying)
great_expectations.jupyter_ux.display_column_expectations_as_section(expectation_suite, column, include_styling=True, return_without_displaying=False)

This is a utility function to render all of the Expectations in an ExpectationSuite with the same column name as an HTML block.

By default, the HTML block is rendered using ExpectationSuiteColumnSectionRenderer and the view is rendered using DefaultJinjaSectionView. Therefore, it should look exactly the same as the default renderer for build_docs.

Example usage: exp = context.get_expectation_suite(“notable_works_by_charles_dickens”, “BasicDatasetProfiler”) display_column_expectations_as_section(exp, “Type”)

great_expectations.jupyter_ux.display_profiled_column_evrs_as_section(evrs, column, include_styling=True, return_without_displaying=False)

This is a utility function to render all of the EVRs in an ExpectationSuite with the same column name as an HTML block.

By default, the HTML block is rendered using ExpectationSuiteColumnSectionRenderer and the view is rendered using DefaultJinjaSectionView. Therefore, it should look exactly the same as the default renderer for build_docs.

Example usage: display_column_evrs_as_section(exp, “my_column”)

WARNING: This method is experimental.

great_expectations.jupyter_ux.display_column_evrs_as_section(evrs, column, include_styling=True, return_without_displaying=False)

Display validation results for a single column as a section.

WARNING: This method is experimental.

great_expectations.jupyter_ux.logger