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/histogram_single_batch_parameter_builder.py b/great_expectations/rule_based_profiler/parameter_builder/histogram_single_batch_parameter_builder.py
--- a/great_expectations/rule_based_profiler/parameter_builder/histogram_single_batch_parameter_builder.py
+++ b/great_expectations/rule_based_profiler/parameter_builder/histogram_single_batch_parameter_builder.py
@@ -1,7 +1,6 @@
-from typing import Any, Dict, List, Optional, Set
+from typing import Dict, List, Optional, Set
 
 import numpy as np
-import pandas as pd
 
 import great_expectations.exceptions as ge_exceptions
 from great_expectations.rule_based_profiler.config import ParameterBuilderConfig
@@ -130,8 +129,7 @@ def _build_parameters(
             FULLY_QUALIFIED_PARAMETER_NAME_VALUE_KEY
         ]
 
-        element: Any
-        if bins is None or all(pd.isnull(element) for element in bins):
+        if bins is None:
             raise ge_exceptions.ProfilerExecutionError(
                 message=f"""Partitioning values for {self.__class__.__name__} by \
 {self._column_partition_metric_single_batch_parameter_builder_config.name} into bins encountered empty or non-existent \


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
@@ -400,9 +400,9 @@ def test_onboarding_data_assistant_get_metrics_and_expectations_using_implicit_i
 @pytest.mark.integration
 @pytest.mark.slow  # 38.26s
 def test_onboarding_data_assistant_get_metrics_and_expectations_using_implicit_invocation_with_estimation_directive(
-    bobby_columnar_table_multi_batch_deterministic_data_context,
+    quentin_columnar_table_multi_batch_data_context,
 ):
-    context: DataContext = bobby_columnar_table_multi_batch_deterministic_data_context
+    context: DataContext = quentin_columnar_table_multi_batch_data_context
 
     batch_request: dict = {
         "datasource_name": "taxi_pandas",
@@ -425,28 +425,6 @@ def test_onboarding_data_assistant_get_metrics_and_expectations_using_implicit_i
     )
 
 
-@pytest.mark.integration
-@pytest.mark.slow  # 38.26s
-@pytest.mark.xfail(
-    strict=True,
-    reason="Temporarily mark as xfail due to issue with congestion_surcharge column resolving to NaN for column.min and column.max",
-)
-def test_onboarding_data_assistant_get_metrics_and_expectations_quentin(
-    quentin_columnar_table_multi_batch_data_context,
-):
-    context: DataContext = quentin_columnar_table_multi_batch_data_context
-
-    batch_request: dict = {
-        "datasource_name": "taxi_pandas",
-        "data_connector_name": "monthly",
-        "data_asset_name": "my_reports",
-    }
-
-    context.assistants.onboarding.run(
-        batch_request=batch_request,
-    )
-
-
 @pytest.mark.integration
 @pytest.mark.slow  # 25.61s
 def test_onboarding_data_assistant_plot_descriptive_notebook_execution_fails(
diff --git a/tests/rule_based_profiler/parameter_builder/test_histogram_single_batch_parameter_builder.py b/tests/rule_based_profiler/parameter_builder/test_histogram_single_batch_parameter_builder.py
--- a/tests/rule_based_profiler/parameter_builder/test_histogram_single_batch_parameter_builder.py
+++ b/tests/rule_based_profiler/parameter_builder/test_histogram_single_batch_parameter_builder.py
@@ -136,6 +136,59 @@ def test_histogram_single_batch_parameter_builder_alice_null_bins(
 
     assert parameter_container.parameter_nodes is None
 
+    with mock.patch(
+        "great_expectations.expectations.metrics.column_aggregate_metrics.column_partition._get_column_partition_using_metrics",
+        return_value=None,
+    ):
+        with pytest.raises(ge_exceptions.ProfilerExecutionError) as excinfo:
+            variables: Optional[ParameterContainer] = None
+            # noinspection PyUnusedLocal
+            parameter_builder.build_parameters(
+                domain=domain,
+                variables=variables,
+                parameters=parameters,
+                batch_request=batch_request,
+            )
+
+        assert (
+            "Partitioning values for HistogramSingleBatchParameterBuilder by column_partition_metric_single_batch_parameter_builder into bins encountered empty or non-existent elements."
+            in str(excinfo.value)
+        )
+
+
+@pytest.mark.integration
+def test_histogram_single_batch_parameter_builder_alice_nan_valued_bins(
+    alice_columnar_table_single_batch_context,
+):
+    data_context: DataContext = alice_columnar_table_single_batch_context
+
+    batch_request: dict = {
+        "datasource_name": "alice_columnar_table_single_batch_datasource",
+        "data_connector_name": "alice_columnar_table_single_batch_data_connector",
+        "data_asset_name": "alice_columnar_table_single_batch_data_asset",
+    }
+
+    parameter_builder: ParameterBuilder = HistogramSingleBatchParameterBuilder(
+        name="my_name",
+        bins="auto",
+        evaluation_parameter_builder_configs=None,
+        data_context=data_context,
+    )
+
+    metric_domain_kwargs: dict = {"column": "my_column"}
+    domain = Domain(
+        domain_type=MetricDomainTypes.COLUMN,
+        domain_kwargs=metric_domain_kwargs,
+        rule_name="my_rule",
+    )
+
+    parameter_container = ParameterContainer(parameter_nodes=None)
+    parameters: Dict[str, ParameterContainer] = {
+        domain.id: parameter_container,
+    }
+
+    assert parameter_container.parameter_nodes is None
+
     with mock.patch(
         "great_expectations.execution_engine.pandas_batch_data.PandasBatchData.dataframe",
         new_callable=mock.PropertyMock,
@@ -151,21 +204,37 @@ def test_histogram_single_batch_parameter_builder_alice_null_bins(
             }
         ),
     ):
-        with pytest.raises(ge_exceptions.ProfilerExecutionError) as excinfo:
-            variables: Optional[ParameterContainer] = None
-            # noinspection PyUnusedLocal
-            parameter_builder.build_parameters(
-                domain=domain,
-                variables=variables,
-                parameters=parameters,
-                batch_request=batch_request,
-            )
+        variables: Optional[ParameterContainer] = None
+        parameter_builder.build_parameters(
+            domain=domain,
+            variables=variables,
+            parameters=parameters,
+            batch_request=batch_request,
+        )
 
-        assert (
-            "Partitioning values for HistogramSingleBatchParameterBuilder by column_partition_metric_single_batch_parameter_builder into bins encountered empty or non-existent elements."
-            in str(excinfo.value)
+        expected_parameter_value: dict = {
+            "value": {"bins": [None], "weights": [], "tail_weights": [0.5, 0.5]},
+            "details": {
+                "metric_configuration": {
+                    "metric_name": "column.histogram",
+                    "domain_kwargs": {"column": "my_column"},
+                    "metric_value_kwargs": {"bins": [None]},
+                    "metric_dependencies": None,
+                },
+                "num_batches": 1,
+            },
+        }
+
+        parameter_node: ParameterNode = get_parameter_value_and_validate_return_type(
+            domain=domain,
+            parameter_reference=parameter_builder.json_serialized_fully_qualified_parameter_name,
+            expected_return_type=None,
+            variables=variables,
+            parameters=parameters,
         )
 
+        assert parameter_node == expected_parameter_value
+
 
 @pytest.mark.integration
 def test_histogram_single_batch_parameter_builder_alice_wrong_type_bins(