Repository: great-expectations/great_expectations

Issue:
Data docs fails to build if a suite was instantiated with metadata.
**Describe the bug**
In the constructor of `ExpectationSuite` if a meta is passed, the `great_expectations.__version__` is not added. This causes data docs to fail to build.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a suite by instantiating an `ExpectationSuite` with some metadata
2. save the suite
3. run `great_expectations docs build`
4. Note error

```python
--- Logging error ---
Traceback (most recent call last):
  File "/Users/taylor/repos/forks/great_expectations/great_expectations/render/renderer/site_builder.py", line 427, in build
    rendered_content = self.renderer_class.render(resource)
  File "/Users/taylor/repos/forks/great_expectations/great_expectations/render/renderer/page_renderer.py", line 457, in render
    self._render_expectation_suite_info(expectations),
  File "/Users/taylor/repos/forks/great_expectations/great_expectations/render/renderer/page_renderer.py", line 539, in _render_expectation_suite_info
    ge_version = expectations.meta["great_expectations.__version__"]
KeyError: 'great_expectations.__version__'
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
 - OS: [e.g. iOS] macOS
 - GE Version: [e.g. 0.10.0] 0.11.5


Discussion:

Resolving patch:
diff --git a/great_expectations/core/__init__.py b/great_expectations/core/__init__.py
--- a/great_expectations/core/__init__.py
+++ b/great_expectations/core/__init__.py
@@ -657,6 +657,8 @@ def __init__(
         self.data_asset_type = data_asset_type
         if meta is None:
             meta = {"great_expectations.__version__": ge_version}
+        if not "great_expectations.__version__" in meta.keys():
+            meta["great_expectations.__version__"] = ge_version
         # We require meta information to be serializable, but do not convert until necessary
         ensure_json_serializable(meta)
         self.meta = meta


Test patch:
diff --git a/tests/core/test_expectation_suite.py b/tests/core/test_expectation_suite.py
--- a/tests/core/test_expectation_suite.py
+++ b/tests/core/test_expectation_suite.py
@@ -267,6 +267,21 @@ def test_expectation_suite_deepcopy(baseline_suite):
     assert baseline_suite.expectations[0].meta["notes"] == "This is an expectation."
 
 
+def test_suite_without_metadata_includes_ge_version_metadata_if_none_is_provided():
+    suite = ExpectationSuite("foo")
+    assert "great_expectations.__version__" in suite.meta.keys()
+
+
+def test_suite_does_not_overwrite_existing_version_metadata():
+    suite = ExpectationSuite("foo", meta={"great_expectations.__version__": "0.0.0"})
+    assert "great_expectations.__version__" in suite.meta.keys()
+    assert suite.meta["great_expectations.__version__"] == "0.0.0"
+
+
+def test_suite_with_metadata_includes_ge_version_metadata(baseline_suite):
+    assert "great_expectations.__version__" in baseline_suite.meta.keys()
+
+
 def test_add_citation(baseline_suite):
     assert (
         "citations" not in baseline_suite.meta
diff --git a/tests/data_asset/test_data_asset_internals.py b/tests/data_asset/test_data_asset_internals.py
--- a/tests/data_asset/test_data_asset_internals.py
+++ b/tests/data_asset/test_data_asset_internals.py
@@ -273,24 +273,24 @@ def test_meta_version_warning():
     asset = ge.data_asset.DataAsset()
 
     with pytest.warns(UserWarning) as w:
-        out = asset.validate(
-            expectation_suite=ExpectationSuite(
-                expectations=[], expectation_suite_name="test", meta={}
-            )
-        )
+        suite = ExpectationSuite(expectations=[], expectation_suite_name="test")
+        # mangle the metadata
+        suite.meta = {"foo": "bar"}
+        out = asset.validate(expectation_suite=suite)
     assert (
         w[0].message.args[0]
         == "WARNING: No great_expectations version found in configuration object."
     )
 
     with pytest.warns(UserWarning) as w:
-        out = asset.validate(
-            expectation_suite=ExpectationSuite(
-                expectations=[],
-                expectation_suite_name="test",
-                meta={"great_expectations.__version__": "0.0.0"},
-            )
+        suite = ExpectationSuite(
+            expectations=[],
+            expectation_suite_name="test",
+            meta={"great_expectations.__version__": "0.0.0"},
         )
+        # mangle the metadata
+        suite.meta = {"great_expectations.__version__": "0.0.0"}
+        out = asset.validate(expectation_suite=suite)
     assert (
         w[0].message.args[0]
         == "WARNING: This configuration object was built using version 0.0.0 of great_expectations, but is currently "