def test_context_profiler(empty_data_context, filesystem_csv_2):
    "This just validates that it's possible to profile using the datasource hook, and have\n    validation results available in the DataContext"
    empty_data_context.add_datasource('my_datasource', module_name='great_expectations.datasource', class_name='PandasDatasource', base_directory=str(filesystem_csv_2))
    not_so_empty_data_context = empty_data_context
    assert (not_so_empty_data_context.list_expectation_suite_keys() == [])
    not_so_empty_data_context.profile_datasource('my_datasource', profiler=BasicDatasetProfiler)
    assert (len(not_so_empty_data_context.list_expectation_suite_keys()) == 1)
    profiled_expectations = not_so_empty_data_context.get_expectation_suite('f1', 'BasicDatasetProfiler')
    print(json.dumps(profiled_expectations, indent=2))
    for exp in profiled_expectations['expectations']:
        assert ('BasicDatasetProfiler' in exp['meta'])
        assert ('confidence' in exp['meta']['BasicDatasetProfiler'])
    assert (profiled_expectations['data_asset_name'] == 'my_datasource/default/f1')
    assert (profiled_expectations['expectation_suite_name'] == 'BasicDatasetProfiler')
    assert ('batch_kwargs' in profiled_expectations['meta']['BasicDatasetProfiler'])
    assert (len(profiled_expectations['expectations']) > 0)
This just validates that it's possible to profile using the datasource hook, and have
validation results available in the DataContext
def test_context_profiler(empty_data_context, filesystem_csv_2):
    "This just validates that it's possible to profile using the datasource hook, and have\n    validation results available in the DataContext"
    empty_data_context.add_datasource('my_datasource', module_name='great_expectations.datasource', class_name='PandasDatasource', base_directory=str(filesystem_csv_2))
    not_so_empty_data_context = empty_data_context
    assert (not_so_empty_data_context.list_expectation_suite_keys() == [])
    not_so_empty_data_context.profile_datasource('my_datasource', profiler=BasicDatasetProfiler)
    assert (len(not_so_empty_data_context.list_expectation_suite_keys()) == 1)
    profiled_expectations = not_so_empty_data_context.get_expectation_suite('f1', 'BasicDatasetProfiler')
    print(json.dumps(profiled_expectations, indent=2))
    for exp in profiled_expectations['expectations']:
        assert ('BasicDatasetProfiler' in exp['meta'])
        assert ('confidence' in exp['meta']['BasicDatasetProfiler'])
    assert (profiled_expectations['data_asset_name'] == 'my_datasource/default/f1')
    assert (profiled_expectations['expectation_suite_name'] == 'BasicDatasetProfiler')
    assert ('batch_kwargs' in profiled_expectations['meta']['BasicDatasetProfiler'])
    assert (len(profiled_expectations['expectations']) > 0)