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_builder/mean_unexpected_map_metric_multi_batch_parameter_builder.py b/great_expectations/rule_based_profiler/parameter_builder/mean_unexpected_map_metric_multi_batch_parameter_builder.py
--- a/great_expectations/rule_based_profiler/parameter_builder/mean_unexpected_map_metric_multi_batch_parameter_builder.py
+++ b/great_expectations/rule_based_profiler/parameter_builder/mean_unexpected_map_metric_multi_batch_parameter_builder.py
@@ -142,7 +142,9 @@ def _build_parameters(
                 parameters=parameters,
             )
         )
-        total_count_values: MetricValues = total_count_parameter_node.value
+        total_count_values: MetricValues = total_count_parameter_node[
+            FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY
+        ]
 
         # Obtain null_count_parameter_builder_name from "rule state" (i.e., variables and parameters); from instance variable otherwise.
         null_count_parameter_builder_name: Optional[
@@ -177,7 +179,9 @@ def _build_parameters(
                 variables=variables,
                 parameters=parameters,
             )
-            null_count_values = null_count_parameter_node.value
+            null_count_values = null_count_parameter_node[
+                FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY
+            ]
 
         nonnull_count_values: np.ndarray = total_count_values - null_count_values
 
@@ -197,7 +201,9 @@ def _build_parameters(
             variables=variables,
             parameters=parameters,
         )
-        unexpected_count_values: MetricValues = parameter_node.value
+        unexpected_count_values: MetricValues = parameter_node[
+            FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY
+        ]
 
         unexpected_count_ratio_values: np.ndarray = (
             unexpected_count_values / nonnull_count_values
@@ -207,6 +213,8 @@ def _build_parameters(
         return Attributes(
             {
                 FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY: mean_unexpected_count_ratio,
-                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node.details,
+                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node[
+                    FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY
+                ],
             }
         )
diff --git a/great_expectations/rule_based_profiler/parameter_builder/numeric_metric_range_multi_batch_parameter_builder.py b/great_expectations/rule_based_profiler/parameter_builder/numeric_metric_range_multi_batch_parameter_builder.py
--- a/great_expectations/rule_based_profiler/parameter_builder/numeric_metric_range_multi_batch_parameter_builder.py
+++ b/great_expectations/rule_based_profiler/parameter_builder/numeric_metric_range_multi_batch_parameter_builder.py
@@ -19,6 +19,7 @@
     MetricValues,
 )
 from great_expectations.rule_based_profiler.types import (
+    FULLY_QUALIFIED_PARAMETER_NAME_ATTRIBUTED_VALUE_KEY,
     FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY,
     FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY,
     Attributes,
@@ -249,7 +250,9 @@ def _build_parameters(
         )
         metric_values: MetricValues = (
             AttributedResolvedMetrics.get_metric_values_from_attributed_metric_values(
-                attributed_metric_values=parameter_node.attributed_value
+                attributed_metric_values=parameter_node[
+                    FULLY_QUALIFIED_PARAMETER_NAME_ATTRIBUTED_VALUE_KEY
+                ]
             )
         )
 
@@ -298,7 +301,9 @@ def _build_parameters(
         return Attributes(
             {
                 FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY: metric_value_range,
-                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node.details,
+                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node[
+                    FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY
+                ],
             }
         )
 
diff --git a/great_expectations/rule_based_profiler/parameter_builder/value_set_multi_batch_parameter_builder.py b/great_expectations/rule_based_profiler/parameter_builder/value_set_multi_batch_parameter_builder.py
--- a/great_expectations/rule_based_profiler/parameter_builder/value_set_multi_batch_parameter_builder.py
+++ b/great_expectations/rule_based_profiler/parameter_builder/value_set_multi_batch_parameter_builder.py
@@ -12,6 +12,7 @@
     MetricValues,
 )
 from great_expectations.rule_based_profiler.types import (
+    FULLY_QUALIFIED_PARAMETER_NAME_ATTRIBUTED_VALUE_KEY,
     FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY,
     FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY,
     Attributes,
@@ -124,7 +125,9 @@ def _build_parameters(
         )
         metric_values: MetricValues = (
             AttributedResolvedMetrics.get_metric_values_from_attributed_metric_values(
-                attributed_metric_values=parameter_node.attributed_value
+                attributed_metric_values=parameter_node[
+                    FULLY_QUALIFIED_PARAMETER_NAME_ATTRIBUTED_VALUE_KEY
+                ]
             )
         )
 
@@ -133,7 +136,9 @@ def _build_parameters(
                 FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY: _get_unique_values_from_nested_collection_of_sets(
                     collection=metric_values
                 ),
-                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node.details,
+                FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY: parameter_node[
+                    FULLY_QUALIFIED_PARAMETER_NAME_METADATA_KEY
+                ],
             }
         )
 


Test patch: