Repository: great-expectations/great_expectations

Issue:
Use cleaner solution for non-truncating division in python 2
Prefer `from __future__ import division` to `1.*x/y`


Discussion:
Done inline during improve_partitions push.

Resolving patch:
diff --git a/great_expectations/core/usage_statistics/util.py b/great_expectations/core/usage_statistics/util.py
--- a/great_expectations/core/usage_statistics/util.py
+++ b/great_expectations/core/usage_statistics/util.py
@@ -16,9 +16,6 @@ def send_usage_message(
     api_version: str = "v3",
     success: bool = False,
 ):
-    if data_context is None:
-        data_context = BaseDataContext.get_data_context()
-
     if not event:
         event = None
 
diff --git a/great_expectations/data_context/data_context.py b/great_expectations/data_context/data_context.py
--- a/great_expectations/data_context/data_context.py
+++ b/great_expectations/data_context/data_context.py
@@ -295,18 +295,6 @@ class BaseDataContext:
 
     _data_context = None
 
-    @classmethod
-    def get_data_context(cls) -> "BaseDataContext":
-        if cls._data_context is None:
-            raise DataContextError(
-                f"Could not retrieve DataContext from empty registry. Please instantiate DataContext before calling get_data_context()."
-            )
-        return cls._data_context
-
-    @classmethod
-    def set_data_context(cls, data_context: "BaseDataContext"):
-        cls._data_context = data_context
-
     @classmethod
     def validate_config(cls, project_config):
         if isinstance(project_config, DataContextConfig):
@@ -407,7 +395,6 @@ def __init__(
 
         self._evaluation_parameter_dependencies_compiled = False
         self._evaluation_parameter_dependencies = {}
-        BaseDataContext.set_data_context(self)
 
     @property
     def ge_cloud_config(self):


Test patch:
diff --git a/tests/data_context/test_data_context.py b/tests/data_context/test_data_context.py
--- a/tests/data_context/test_data_context.py
+++ b/tests/data_context/test_data_context.py
@@ -62,49 +62,6 @@ def parameterized_expectation_suite():
         return json.load(suite)
 
 
-def test_get_data_context_no_context_instantiated():
-    """
-    What does this test and why?
-
-    The get_data_context() and set_data_context() methods were added as part of PR #3812 and #3819 which introduces a registry
-    for BaseDataContext. This PR introduces a registry for DataContext so that it is accessible throughout GE. The next 3 tests test this functionality.
-
-    This test tests whether the correct error is raised if we try to retrieve a BaseDataContext from a registry that has not been instantiated (set to None)
-    """
-    BaseDataContext.set_data_context(None)
-    with pytest.raises(ge_exceptions.DataContextError) as e:
-        BaseDataContext.get_data_context()
-
-    assert (
-        "Could not retrieve DataContext from empty registry. Please instantiate DataContext before calling "
-        "get_data_context()" in str(e.value)
-    )
-
-
-def test_get_data_context(titanic_data_context):
-    """
-    This test tests whether the registry contains the identical data_context to the only that was passed in as a param.
-    """
-    my_data_context: BaseDataContext = BaseDataContext.get_data_context()
-    assert my_data_context is not None
-    assert my_data_context is titanic_data_context
-
-
-def test_set_data_context(
-    titanic_data_context, empty_data_context_with_config_variables
-):
-    """
-    This test tests whether the registry contains only the most recent data_context object.
-    """
-    my_data_context: BaseDataContext = BaseDataContext.get_data_context()
-    assert my_data_context is empty_data_context_with_config_variables
-
-    # set as previous context
-    DataContext.set_data_context(titanic_data_context)
-    my_data_context: BaseDataContext = DataContext.get_data_context()
-    assert my_data_context is titanic_data_context
-
-
 def test_create_duplicate_expectation_suite(titanic_data_context):
     # create new expectation suite
     assert titanic_data_context.create_expectation_suite(