diff --git a/great_expectations/render/renderer/page_renderer.py b/great_expectations/render/renderer/page_renderer.py index aa3ccf273c68..46e72b4bad28 100644 --- a/great_expectations/render/renderer/page_renderer.py +++ b/great_expectations/render/renderer/page_renderer.py @@ -235,6 +235,9 @@ def _render_validation_header(cls, validation_results): expectation_suite_path = ( os.path.join(*expectation_suite_path_components) + ".html" ) + data_asset_name = ( + validation_results.meta["batch_kwargs"].get("data_asset_name") + ) if success: success = "Succeeded" html_success_icon = ( @@ -262,9 +265,11 @@ def _render_validation_header(cls, validation_results): **{ "content_block_type": "string_template", "string_template": { - "template": "${suite_title} ${expectation_suite_name}\n${status_title} ${html_success_icon} ${success}", + "template": "${suite_title} ${expectation_suite_name}\n ${data_asset} ${data_asset_name}\n ${status_title} ${html_success_icon} ${success}", "params": { "suite_title": "Expectation Suite:", + "data_asset": "Data asset:", + "data_asset_name": data_asset_name, "status_title": "Status:", "expectation_suite_name": expectation_suite_name, "success": success, diff --git a/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json b/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json index a9d8958802d6..7c1ccc81a86c 100644 --- a/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json +++ b/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json @@ -31,9 +31,11 @@ "subheader": { "content_block_type": "string_template", "string_template": { - "template": "${suite_title} ${expectation_suite_name}\n${status_title} ${html_success_icon} ${success}", + "template": "${suite_title} ${expectation_suite_name}\n ${data_asset} ${data_asset_name}\n ${status_title} ${html_success_icon} ${success}", "params": { "suite_title": "Expectation Suite:", + "data_asset": "Data asset:", + "data_asset_name": null, "status_title": "Status:", "expectation_suite_name": "default", "success": "Failed", diff --git a/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json b/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json index 903f5b7cd7d4..77193bc84535 100644 --- a/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json +++ b/tests/render/fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json @@ -31,9 +31,11 @@ "subheader": { "content_block_type": "string_template", "string_template": { - "template": "${suite_title} ${expectation_suite_name}\n${status_title} ${html_success_icon} ${success}", + "template": "${suite_title} ${expectation_suite_name}\n ${data_asset} ${data_asset_name}\n ${status_title} ${html_success_icon} ${success}", "params": { "suite_title": "Expectation Suite:", + "data_asset": "Data asset:", + "data_asset_name": null, "status_title": "Status:", "expectation_suite_name": "default", "success": "Failed", @@ -4715,4 +4717,4 @@ "batch_kwargs": { "ge_batch_id": "f499679e-6c5e-11ea-8d20-acde48001122" } -} +} \ No newline at end of file diff --git a/tests/render/test_default_markdown_view.py b/tests/render/test_default_markdown_view.py index 088a4664eea0..665b48e7e073 100644 --- a/tests/render/test_default_markdown_view.py +++ b/tests/render/test_default_markdown_view.py @@ -126,6 +126,7 @@ def test_snapshot_render_section_page_with_fixture_data(validation_operator_resu ## Overview ### **Expectation Suite:** **basic.warning** +**Data asset:** **None** **Status:** **Failed** @@ -293,6 +294,7 @@ def test_snapshot_render_section_page_with_fixture_data(validation_operator_resu ## Overview ### **Expectation Suite:** **basic.warning** +**Data asset:** **None** **Status:** **Failed** @@ -498,6 +500,7 @@ def test_render_section_page_with_fixture_data_multiple_validations( ## Overview ### **Expectation Suite:** **basic.warning** +**Dataasset:** **None** **Status:** **Failed** @@ -665,6 +668,7 @@ def test_render_section_page_with_fixture_data_multiple_validations( ## Overview ### **Expectation Suite:** **basic.warning** +**Dataasset:** **None** **Status:** **Failed** diff --git a/tests/render/test_page_renderer.py b/tests/render/test_page_renderer.py index e4c2c83f1c31..96735b499de2 100644 --- a/tests/render/test_page_renderer.py +++ b/tests/render/test_page_renderer.py @@ -212,9 +212,11 @@ def test_ValidationResultsPageRenderer_render_validation_header( "subheader": { "content_block_type": "string_template", "string_template": { - "template": "${suite_title} ${expectation_suite_name}\n${status_title} ${html_success_icon} ${success}", + "template": "${suite_title} ${expectation_suite_name}\n ${data_asset} ${data_asset_name}\n ${status_title} ${html_success_icon} ${success}", "params": { "suite_title": "Expectation Suite:", + "data_asset": "Data asset:", + "data_asset_name": None, "status_title": "Status:", "expectation_suite_name": "default", "success": "Failed", @@ -236,8 +238,8 @@ def test_ValidationResultsPageRenderer_render_validation_header( }, }, } - - # print(validation_header) + import pprint + pprint.pprint(validation_header) assert validation_header == expected_validation_header @@ -512,10 +514,11 @@ def test_snapshot_ValidationResultsPageRenderer_render_with_run_info_at_end( rendered_validation_results = validation_results_page_renderer.render( titanic_profiled_evrs_1 ).to_json_dict() - print(rendered_validation_results) - # with open(file_relative_path(__file__, "./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end.json"), "w") as f: - # json.dump(rendered_validation_results, f, indent=2) - + import pprint + pprint.pprint(rendered_validation_results['sections']) + with open(file_relative_path(__file__, "./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_end_nc.json"), "w") as f: + json.dump(rendered_validation_results, f, indent=2) + # pprint.pprint(ValidationResultsPageRenderer_render_with_run_info_at_end) assert ( rendered_validation_results == ValidationResultsPageRenderer_render_with_run_info_at_end @@ -532,9 +535,9 @@ def test_snapshot_ValidationResultsPageRenderer_render_with_run_info_at_start( rendered_validation_results = validation_results_page_renderer.render( titanic_profiled_evrs_1 ).to_json_dict() - print(rendered_validation_results) - # with open(file_relative_path(__file__, "./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start.json"), "w") as f: - # json.dump(rendered_validation_results, f, indent=2) + # print(rendered_validation_results) + with open(file_relative_path(__file__, "./fixtures/ValidationResultsPageRenderer_render_with_run_info_at_start_nc.json"), "w") as f: + json.dump(rendered_validation_results, f, indent=2) assert ( rendered_validation_results