Hello @rachel.house,
thank you for your response. I’m happy that you’re trying to help me.
Your suggestion is what I’ve already tried first but when I submit the context_root_dir value to the get_context method and then print the context no context_root_dir can be found.
try:
context_root_dir = f"{project.MNT_PATH}/tests/gx"
context = gx.get_context(context_root_dir=context_root_dir)
print("context_root_dir: "+str(context_root_dir))
print("context: "+str(context))
dataframe_datasource = context.sources.add_or_update_spark(
name="my_spark_in_memory_datasource",
)
except Exception as exception:
handle_exception(exception, dbutils.notebook.entry_point.getDbutils().notebook().getContext())
raise exception
This results in the following console printout:
context_root_dir: /mnt/sdl/control-tower-ccu/tests/gx
context: {
"anonymous_usage_statistics": {
"explicit_url": false,
"explicit_id": true,
"enabled": true,
"data_context_id": "9189d9aa-ed79-481f-8817-3cd5b9c3b15f",
"usage_statistics_url": "https://stats.greatexpectations.io/great_expectations/v1/usage_statistics"
},
"checkpoint_store_name": "checkpoint_store",
"config_version": 3,
"data_docs_sites": {
"local_site": {
"class_name": "SiteBuilder",
"show_how_to_buttons": true,
"store_backend": {
"class_name": "TupleFilesystemStoreBackend",
"base_directory": "/tmp/tmpra0l_8jx"
},
"site_index_builder": {
"class_name": "DefaultSiteIndexBuilder"
}
}
},
"datasources": {},
"evaluation_parameter_store_name": "evaluation_parameter_store",
"expectations_store_name": "expectations_store",
"fluent_datasources": {},
"include_rendered_content": {
"expectation_suite": false,
"expectation_validation_result": false,
"globally": false
},
"profiler_store_name": "profiler_store",
"stores": {
"expectations_store": {
"class_name": "ExpectationsStore",
"store_backend": {
"class_name": "InMemoryStoreBackend"
}
},
"validations_store": {
"class_name": "ValidationsStore",
"store_backend": {
"class_name": "InMemoryStoreBackend"
}
},
"evaluation_parameter_store": {
"class_name": "EvaluationParameterStore"
},
"checkpoint_store": {
"class_name": "CheckpointStore",
"store_backend": {
"class_name": "InMemoryStoreBackend"
}
},
"profiler_store": {
"class_name": "ProfilerStore",
"store_backend": {
"class_name": "InMemoryStoreBackend"
}
}
},
"validations_store_name": "validations_store"
}
I assume this is why my directory in /mnt/sdl/control-tower-ccu/tests/gx remains empty after I follow the whole Tutorial Get started with Great Expectations and Databricks on the DataFrame-path.
After I created a gx context and then
context = gx.get_context(context_root_dir=context_root_dir)
dataframe_datasource = context.sources.add_or_update_spark ...
dataframe_asset = dataframe_datasource.add_dataframe_asset ...
batch_request = dataframe_asset.build_batch_request()
context.add_or_update_expectation_suite ...
validator = context.get_validator ...
with the 2 expectations
validator.expect_column_values_to_not_be_null ...
validator.expect_column_values_to_be_between ...
validator.save_expectation_suite
checkpoint = Checkpoint ...
context.add_or_update_checkpoint(checkpoint=checkpoint)
checkpoint_result = checkpoint.run()
I can not find any results anywhere. I can’t even find /tmp/tmpra0l_8jx