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
@@ -1,4 +1,4 @@
-from typing import Any, Dict, List, Optional, Tuple, Union
+from typing import Any, Dict, List, Optional, Set, Tuple, Union
 
 import numpy as np
 
@@ -26,6 +26,15 @@ class MeanUnexpectedMapMetricMultiBatchParameterBuilder(
     Compute mean unexpected count ratio (as a fraction) of a specified map-style metric across all specified batches.
     """
 
+    exclude_field_names: Set[
+        str
+    ] = MetricMultiBatchParameterBuilder.exclude_field_names | {
+        "metric_name",
+        "enforce_numeric_metric",
+        "replace_nan_with_zero",
+        "reduce_scalar_metric",
+    }
+
     def __init__(
         self,
         name: str,


Test patch:
diff --git a/tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py b/tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py
--- a/tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py
+++ b/tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py
@@ -41,6 +41,7 @@ def test_instantiation_mean_unexpected_map_metric_multi_batch_parameter_builder_
     )
 
     with pytest.raises(TypeError) as excinfo:
+        # noinspection PyArgumentList
         _: MeanUnexpectedMapMetricMultiBatchParameterBuilder = (
             MeanUnexpectedMapMetricMultiBatchParameterBuilder(
                 name="my_name",
@@ -55,6 +56,7 @@ def test_instantiation_mean_unexpected_map_metric_multi_batch_parameter_builder_
     )
 
     with pytest.raises(TypeError) as excinfo:
+        # noinspection PyArgumentList
         _: MeanUnexpectedMapMetricMultiBatchParameterBuilder = (
             MeanUnexpectedMapMetricMultiBatchParameterBuilder(
                 name="my_name",
@@ -275,3 +277,47 @@ def test_mean_unexpected_map_metric_multi_batch_parameter_builder_bobby_datetime
         atol=atol,
         err_msg=f"Actual value of {actual_parameter_value.value} differs from expected value of {expected_parameter_value} by more than {atol + rtol * abs(actual_parameter_value.value)} tolerance.",
     )
+
+
+def test_mean_unexpected_map_metric_multi_batch_parameter_builder_bobby_check_serialized_keys(
+    bobby_columnar_table_multi_batch_deterministic_data_context,
+):
+    data_context: DataContext = (
+        bobby_columnar_table_multi_batch_deterministic_data_context
+    )
+
+    batch_request: dict = {
+        "datasource_name": "taxi_pandas",
+        "data_connector_name": "monthly",
+        "data_asset_name": "my_reports",
+    }
+
+    metric_domain_kwargs_for_parameter_builder: str = "$domain.domain_kwargs"
+
+    mean_unexpected_map_metric_multi_batch_parameter_builder: MeanUnexpectedMapMetricMultiBatchParameterBuilder = MeanUnexpectedMapMetricMultiBatchParameterBuilder(
+        name="my_pickup_datetime_count_values_unique_mean_unexpected_map_metric",
+        map_metric_name="column_values.unique",
+        total_count_parameter_builder_name="my_total_count",
+        null_count_parameter_builder_name="my_null_count",
+        metric_domain_kwargs=metric_domain_kwargs_for_parameter_builder,
+        metric_value_kwargs=None,
+        batch_list=None,
+        batch_request=batch_request,
+        json_serialize=False,
+        data_context=data_context,
+    )
+
+    assert set(
+        mean_unexpected_map_metric_multi_batch_parameter_builder.to_json_dict().keys()
+    ) == {
+        "class_name",
+        "module_name",
+        "name",
+        "map_metric_name",
+        "total_count_parameter_builder_name",
+        "null_count_parameter_builder_name",
+        "metric_domain_kwargs",
+        "metric_value_kwargs",
+        "batch_request",
+        "json_serialize",
+    }