Skip to content

Commit

Permalink
Replaced hard-coded validations store names with one obtained from th…
Browse files Browse the repository at this point in the history
…e config
  • Loading branch information
eugmandel committed Aug 16, 2019
1 parent cf2944b commit f970021
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion great_expectations/data_context/data_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ def get_validation_result(
"""

selected_store = self.stores["local_validation_result_store"]
selected_store = self.stores[validations_store_name]

if run_id == None:
run_id = selected_store.get_most_recent_run_id()
Expand Down
7 changes: 4 additions & 3 deletions great_expectations/render/renderer/site_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def build(cls, data_context, site_config, specified_data_asset_name=None):
datasources_to_document,
specified_data_asset_name,
site_config['site_store'],
site_config['profiling_store']['name']
)

# validations
Expand Down Expand Up @@ -144,7 +145,7 @@ def build(cls, data_context, site_config, specified_data_asset_name=None):
#!!! This validations_store_name is hardcoded and might not exist. Tests are passing, though.
validation = data_context.get_validation_result(data_asset_name,
expectation_suite_name=expectation_suite_name,
validations_store_name="local_validation_result_store",#=site_config['validations_store'],
validations_store_name=site_config['validations_store']['name'],
run_id=run_id)

logger.info(" Rendering validation: run id: {}, suite {} for data asset {}".format(run_id, expectation_suite_name, data_asset_name))
Expand Down Expand Up @@ -246,7 +247,7 @@ def get_renderer_and_view_classes(cls, section_config):


@classmethod
def generate_profiling_section(cls, section_config, data_context, index_links_dict, datasources_to_document, specified_data_asset_name, resource_store):
def generate_profiling_section(cls, section_config, data_context, index_links_dict, datasources_to_document, specified_data_asset_name, resource_store, validations_store_name):
profiling_renderer_class, profiling_view_class = cls.get_renderer_and_view_classes(section_config)

nested_namespaced_validation_result_dict = cls.pack_validation_result_list_into_nested_dict(
Expand All @@ -272,7 +273,7 @@ def generate_profiling_section(cls, section_config, data_context, index_links_di
#!!! This validations_store_name is hardcoded and might not exist. Tests are passing, though.
validation = data_context.get_validation_result(data_asset_name,
expectation_suite_name=expectation_suite_name,
validations_store_name="profiling_store",#site_config['profiling_store'],
validations_store_name=validations_store_name,
run_id=run_id)
logger.info(" Rendering profiling for data asset {}".format(data_asset_name))
data_asset_name = validation['meta']['data_asset_name']
Expand Down

0 comments on commit f970021

Please sign in to comment.