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/rule_based_profiler/parameter_container.py b/great_expectations/rule_based_profiler/parameter_container.py
--- a/great_expectations/rule_based_profiler/parameter_container.py
+++ b/great_expectations/rule_based_profiler/parameter_container.py
@@ -230,13 +230,13 @@ def to_json_dict(self) -> dict:
 def deep_convert_properties_iterable_to_parameter_node(
     source: Union[T, dict]
 ) -> Union[T, ParameterNode]:
-    if type(source) == dict:
+    if isinstance(source, dict):
         return _deep_convert_properties_iterable_to_parameter_node(
             source=ParameterNode(source)
         )
 
     # Must allow for non-dictionary source types, since their internal nested structures may contain dictionaries.
-    if type(source) in (list, set, tuple):
+    if isinstance(source, (list, set, tuple)):
         data_type: type = type(source)
 
         element: Any
@@ -254,11 +254,11 @@ def _deep_convert_properties_iterable_to_parameter_node(source: dict) -> Paramet
     key: str
     value: Any
     for key, value in source.items():
-        if type(value) == dict:
+        if isinstance(value, dict):
             source[key] = _deep_convert_properties_iterable_to_parameter_node(
                 source=value
             )
-        elif type(value) in (list, set, tuple):
+        elif isinstance(value, (list, set, tuple)):
             data_type: type = type(value)
 
             element: Any
diff --git a/great_expectations/validator/metric_configuration.py b/great_expectations/validator/metric_configuration.py
--- a/great_expectations/validator/metric_configuration.py
+++ b/great_expectations/validator/metric_configuration.py
@@ -69,10 +69,40 @@ def metric_dependencies(self, metric_dependencies) -> None:
 
     def get_domain(self) -> Domain:
         """Return "Domain" object, constructed from this "MetricConfiguration" object."""
-        return Domain(
-            domain_type=self.get_domain_type(),
-            domain_kwargs=self._metric_domain_kwargs,
-        )
+        domain_type: MetricDomainTypes = self.get_domain_type()
+
+        if domain_type == MetricDomainTypes.TABLE:
+            return Domain(
+                domain_type=domain_type,
+                domain_kwargs={},
+            )
+
+        if domain_type == MetricDomainTypes.COLUMN:
+            return Domain(
+                domain_type=domain_type,
+                domain_kwargs={
+                    "column": self._metric_domain_kwargs["column"],
+                },
+            )
+
+        if domain_type == MetricDomainTypes.COLUMN_PAIR:
+            return Domain(
+                domain_type=domain_type,
+                domain_kwargs={
+                    "column_A": self._metric_domain_kwargs["column_A"],
+                    "column_B": self._metric_domain_kwargs["column_B"],
+                },
+            )
+
+        if domain_type == MetricDomainTypes.MULTICOLUMN:
+            return Domain(
+                domain_type=domain_type,
+                domain_kwargs={
+                    "column_list": self._metric_domain_kwargs["column_list"],
+                },
+            )
+
+        raise ValueError(f"""Domain type "{domain_type}" is not recognized.""")
 
     def get_domain_type(self) -> MetricDomainTypes:
         """Return "domain_type" of this "MetricConfiguration" object."""


Test patch:
diff --git a/tests/validator/test_metric_configuration.py b/tests/validator/test_metric_configuration.py
--- a/tests/validator/test_metric_configuration.py
+++ b/tests/validator/test_metric_configuration.py
@@ -55,14 +55,11 @@ def test_metric_configuration_get_domain(
 ) -> None:
     assert table_head_metric_config.get_domain() == Domain(
         domain_type=MetricDomainTypes.TABLE,
-        domain_kwargs={
-            "batch_id": "abc123",
-        },
+        domain_kwargs={},
     )
     assert column_histogram_metric_config.get_domain() == Domain(
         domain_type=MetricDomainTypes.COLUMN,
         domain_kwargs={
             "column": "my_column",
-            "batch_id": "def456",
         },
     )