ExpectationSuite from .json file

Using GE 1.2.4, how do I import ExpectationSuite from .json file like this one? thx

{
    "name": "attribute",
    "meta": {
        "great_expectations.__version__": "1.2.4",
        "columns": {
            "Unnamed: 0": {
                "description": ""
            },
            "itid": {
                "description": ""
            },
            "id": {
                "description": ""
            },
            "request_time": {
                "description": ""
            }
        }
    },
    "expectations": [
        {
            "meta": {},
            "type": "expect_table_column_count_to_equal",
            "kwargs": {
                "value": 3
            }
        },
        {
            "meta": {},
            "type": "expect_table_columns_to_match_ordered_list",
            "kwargs": {
                "column_list": [
                    "itid",
                    "id",
                    "request_time"
                ]
            }
        }
    ]
}

You can do this by updating the store_backend configuration’s base_directory value to point to an absolute path, or a path relative to the File Data Context’s project_root_dir.

Directions on updating the base path of the expectation store are here.

That may work for a file base store, but what if I am using

"store_backend": {
        "class_name": "InMemoryStoreBackend"
}

You can possibly try to convert it to a python dict (my_dict = json.loads(json_str) ) and then do gx.ExpectationSuite(**my_dict) though I have not yet tried this

1 Like