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/types/data_assistant_result/data_assistant_result.py b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
--- a/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
+++ b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
@@ -1,6 +1,6 @@
 import copy
 from abc import abstractmethod
-from dataclasses import asdict, dataclass
+from dataclasses import dataclass
 from typing import Any, Dict, List, Optional, Tuple, Union
 
 import altair as alt
@@ -34,19 +34,39 @@ class DataAssistantResult(SerializableDictDot):
     """
 
     profiler_config: Optional["RuleBasedProfilerConfig"] = None  # noqa: F821
-    metrics_by_domain: Optional[Dict[Domain, Dict[str, Any]]] = None
+    metrics_by_domain: Optional[Dict[Domain, Dict[str, ParameterNode]]] = None
     # Obtain "expectation_configurations" using "expectation_configurations = expectation_suite.expectations".
     # Obtain "meta/details" using "meta = expectation_suite.meta".
     expectation_suite: Optional[ExpectationSuite] = None
     execution_time: Optional[float] = None  # Execution time (in seconds).
 
     def to_dict(self) -> dict:
-        """Returns: this DataAssistantResult as a dictionary"""
-        return asdict(self)
+        """
+        Returns: This DataAssistantResult as dictionary (JSON-serializable dictionary for DataAssistantResult objects).
+        """
+        domain: Domain
+        parameter_values_for_fully_qualified_parameter_names: Dict[str, ParameterNode]
+        return {
+            "profiler_config": self.profiler_config.to_json_dict(),
+            "metrics_by_domain": [
+                {
+                    "domain_id": domain.id,
+                    "domain": domain.to_json_dict(),
+                    "parameter_values_for_fully_qualified_parameter_names": convert_to_json_serializable(
+                        data=parameter_values_for_fully_qualified_parameter_names
+                    ),
+                }
+                for domain, parameter_values_for_fully_qualified_parameter_names in self.metrics_by_domain.items()
+            ],
+            "expectation_suite": self.expectation_suite.to_json_dict(),
+            "execution_time": convert_to_json_serializable(data=self.execution_time),
+        }
 
     def to_json_dict(self) -> dict:
-        """Returns: this DataAssistantResult as a json dictionary"""
-        return convert_to_json_serializable(data=self.to_dict())
+        """
+        Returns: This DataAssistantResult as JSON-serializable dictionary.
+        """
+        return self.to_dict()
 
     def get_attributed_metrics_by_domain(
         self,


Test patch:
diff --git a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
--- a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
+++ b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
@@ -2565,36 +2565,22 @@ def volume_data_assistant_result(
 ):
     context: DataContext = bobby_columnar_table_multi_batch_deterministic_data_context
 
-    expectation_suite: ExpectationSuite = get_or_create_expectation_suite(
-        data_context=context,
-        expectation_suite=None,
-        expectation_suite_name="my_suite",
-        component_name=None,
-    )
-
     batch_request: dict = {
         "datasource_name": "taxi_pandas",
         "data_connector_name": "monthly",
         "data_asset_name": "my_reports",
     }
 
-    validator: Validator = get_validator_with_expectation_suite(
-        batch_request=batch_request,
+    expectation_suite: ExpectationSuite = get_or_create_expectation_suite(
         data_context=context,
-        expectation_suite_name=None,
-        expectation_suite=expectation_suite,
-        component_name="volume_data_assistant",
-    )
-
-    data_assistant: DataAssistant = VolumeDataAssistant(
-        name="test_volume_data_assistant",
-        validator=validator,
+        expectation_suite=None,
+        expectation_suite_name="my_suite",
+        component_name=None,
     )
 
-    data_assistant_result: DataAssistantResult = data_assistant.run(
-        expectation_suite=expectation_suite
+    return context.assistants.volume.run(
+        batch_request=batch_request, expectation_suite=expectation_suite
     )
-    return data_assistant_result
 
 
 def run_volume_data_assistant_result_jupyter_notebook_with_new_cell(
@@ -2703,6 +2689,20 @@ def run_volume_data_assistant_result_jupyter_notebook_with_new_cell(
     ep.preprocess(nb, {"metadata": {"path": root_dir}})
 
 
+def test_volume_data_assistant_result_serialization(
+    volume_data_assistant_result: VolumeDataAssistantResult,
+) -> None:
+    volume_data_assistant_result_as_dict: dict = volume_data_assistant_result.to_dict()
+    assert (
+        volume_data_assistant_result_as_dict is not None
+        and len(volume_data_assistant_result_as_dict) == 4
+    )
+    assert (
+        volume_data_assistant_result.to_json_dict()
+        == volume_data_assistant_result_as_dict
+    )
+
+
 @freeze_time("09/26/2019 13:42:41")
 def test_get_metrics_and_expectations_using_explicit_instantiation(
     quentin_columnar_table_multi_batch_data_context,