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/data_assistant/data_assistant.py b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
--- a/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
+++ b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
@@ -167,6 +167,23 @@ def column_values_nonnull_unexpected_count_metric_multi_batch_parameter_builder(
                 data_context=None,
             )
 
+        @property
+        def column_values_null_unexpected_count_metric_multi_batch_parameter_builder(
+            self,
+        ) -> ParameterBuilder:
+            return MetricMultiBatchParameterBuilder(
+                name="column_values.null.unexpected_count",
+                metric_name="column_values.null.unexpected_count",
+                metric_domain_kwargs=DOMAIN_KWARGS_PARAMETER_FULLY_QUALIFIED_NAME,
+                metric_value_kwargs=None,
+                enforce_numeric_metric=False,
+                replace_nan_with_zero=False,
+                reduce_scalar_metric=True,
+                evaluation_parameter_builder_configs=None,
+                json_serialize=False,
+                data_context=None,
+            )
+
     COMMONLY_USED_PARAMETER_BUILDERS: CommonlyUsedParameterBuilders = (
         CommonlyUsedParameterBuilders()
     )
diff --git a/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
--- a/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
+++ b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
@@ -52,11 +52,19 @@ def metrics_parameter_builders_by_domain(
         column_values_unique_unexpected_count_metric_multi_batch_parameter_builder: ParameterBuilder = (
             DataAssistant.COMMONLY_USED_PARAMETER_BUILDERS.column_values_unique_unexpected_count_metric_multi_batch_parameter_builder
         )
+        column_values_nonnull_unexpected_count_metric_multi_batch_parameter_builder: ParameterBuilder = (
+            DataAssistant.COMMONLY_USED_PARAMETER_BUILDERS.column_values_nonnull_unexpected_count_metric_multi_batch_parameter_builder
+        )
+        column_values_null_unexpected_count_metric_multi_batch_parameter_builder: ParameterBuilder = (
+            DataAssistant.COMMONLY_USED_PARAMETER_BUILDERS.column_values_null_unexpected_count_metric_multi_batch_parameter_builder
+        )
 
         set_parameter_builders_json_serialize(
             parameter_builders=[
                 table_row_count_metric_multi_batch_parameter_builder,
                 column_values_unique_unexpected_count_metric_multi_batch_parameter_builder,
+                column_values_nonnull_unexpected_count_metric_multi_batch_parameter_builder,
+                column_values_null_unexpected_count_metric_multi_batch_parameter_builder,
             ],
             json_serialize=True,
         )
@@ -67,6 +75,8 @@ def metrics_parameter_builders_by_domain(
             ],
             Domain(domain_type=MetricDomainTypes.COLUMN,): [
                 column_values_unique_unexpected_count_metric_multi_batch_parameter_builder,
+                column_values_nonnull_unexpected_count_metric_multi_batch_parameter_builder,
+                column_values_null_unexpected_count_metric_multi_batch_parameter_builder,
             ],
         }
 
@@ -92,9 +102,43 @@ def rules(self) -> Optional[List[Rule]]:
             max_unexpected_ratio=None,
             min_max_unexpected_values_proportion=9.75e-1,
         )
+        column_value_nullity_rule: Rule = build_map_metric_rule(
+            rule_name="column_value_nullity_rule",
+            expectation_type="expect_column_values_to_be_null",
+            map_metric_name="column_values.null",
+            include_column_names=None,
+            exclude_column_names=None,
+            include_column_name_suffixes=None,
+            exclude_column_name_suffixes=None,
+            semantic_type_filter_module_name=None,
+            semantic_type_filter_class_name=None,
+            include_semantic_types=None,
+            exclude_semantic_types=None,
+            max_unexpected_values=0,
+            max_unexpected_ratio=None,
+            min_max_unexpected_values_proportion=9.75e-1,
+        )
+        column_value_nonnullity_rule: Rule = build_map_metric_rule(
+            rule_name="column_value_nonnullity_rule",
+            expectation_type="expect_column_values_to_not_be_null",
+            map_metric_name="column_values.nonnull",
+            include_column_names=None,
+            exclude_column_names=None,
+            include_column_name_suffixes=None,
+            exclude_column_name_suffixes=None,
+            semantic_type_filter_module_name=None,
+            semantic_type_filter_class_name=None,
+            include_semantic_types=None,
+            exclude_semantic_types=None,
+            max_unexpected_values=0,
+            max_unexpected_ratio=None,
+            min_max_unexpected_values_proportion=9.75e-1,
+        )
 
         return [
             column_value_uniqueness_rule,
+            column_value_nullity_rule,
+            column_value_nonnullity_rule,
         ]
 
     def _build_data_assistant_result(


Test patch:
diff --git a/tests/rule_based_profiler/data_assistant/test_onboarding_data_assistant.py b/tests/rule_based_profiler/data_assistant/test_onboarding_data_assistant.py
--- a/tests/rule_based_profiler/data_assistant/test_onboarding_data_assistant.py
+++ b/tests/rule_based_profiler/data_assistant/test_onboarding_data_assistant.py
@@ -36,4 +36,4 @@ def test_onboarding_data_assistant_result_serialization(
         onboarding_data_assistant_result.to_json_dict()
         == onboarding_data_assistant_result_as_dict
     )
-    assert len(onboarding_data_assistant_result.profiler_config.rules) == 2
+    assert len(onboarding_data_assistant_result.profiler_config.rules) == 4