Hi,
I am trying to add an ExpectationsStore
with a TupleAzureBlobStoreBackend
to DataContext
, but I keep encountering errors related to saving the configuration to a YAML file:
ruamel.yaml.representer.RepresenterError: cannot represent an object:
I’m using the following versions:
great-expectations==1.1.0
ruamel.yaml==0.17.17
Steps to Reproduce the Error:
data_context = gx.get_context(project_root_dir="./expectations", mode="file")
store_config = {
'class_name': 'ExpectationsStore',
'store_backend': {
'class_name': 'TupleAzureBlobStoreBackend',
'container': 'container',
'prefix': 'expectations',
'connection_string': 'string',
},
}
data_context.add_store(name="expectations_store", config=store_config)
Analysis:
I believe the issue stems from this part of the great_expectations.data_context.abstract_data_context
module:
def _build_store_from_config(self, name: str, config: dict | StoreConfigTypedDict) -> Store:
module_name = "great_expectations.data_context.store"
# Set expectations_store.store_backend_id to the data_context_id from the project_config if
# the expectations_store does not yet exist by:
# adding the data_context_id from the project_config
# to the store_config under the key manually_initialize_store_backend_id
if (name == self.expectations_store_name) and config.get("store_backend"):
config["store_backend"].update(
{"manually_initialize_store_backend_id": self.variables.data_context_id}
)
The data_context_id
is a UUID, and when this UUID is added to the configuration, ruamel.yaml
seems unable to parse it as a string, which causes the error.
Question:
Do you have any advice on how to resolve this error and correctly create the configuration?