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/rule_based_profiler.py b/great_expectations/rule_based_profiler/rule_based_profiler.py
--- a/great_expectations/rule_based_profiler/rule_based_profiler.py
+++ b/great_expectations/rule_based_profiler/rule_based_profiler.py
@@ -381,7 +381,7 @@ def reconcile_profiler_variables(
         :return: reconciled variables in their canonical ParameterContainer object form
         """
         effective_variables: ParameterContainer
-        if variables is not None and isinstance(variables, dict):
+        if variables and isinstance(variables, dict):
             variables_configs: dict = self.variables.to_dict()["parameter_nodes"][
                 "variables"
             ]["variables"]
diff --git a/great_expectations/validator/validator.py b/great_expectations/validator/validator.py
--- a/great_expectations/validator/validator.py
+++ b/great_expectations/validator/validator.py
@@ -766,6 +766,7 @@ def resolve_validation_graph(
         graph: ValidationGraph,
         metrics: Dict[Tuple[str, str, str], Any],
         runtime_configuration: Optional[dict] = None,
+        min_graph_edges_pbar_enable: int = 0,  # Set to low number (e.g., 3) to suppress progress bar for small graphs.
     ) -> Dict[
         Tuple[str, str, str],
         Dict[str, Union[MetricConfiguration, Set[ExceptionInfo], int]],
@@ -812,7 +813,7 @@ def resolve_validation_graph(
                     if "metric_calculations" in progress_bars:
                         disable = not progress_bars["metric_calculations"]
 
-            if len(graph.edges) < 3:
+            if len(graph.edges) < min_graph_edges_pbar_enable:
                 disable = True
 
             if pbar is None:


Test patch:
diff --git a/tests/test_fixtures/rule_based_profiler/alice_user_workflow_verbose_profiler_config.yml b/tests/test_fixtures/rule_based_profiler/alice_user_workflow_verbose_profiler_config.yml
--- a/tests/test_fixtures/rule_based_profiler/alice_user_workflow_verbose_profiler_config.yml
+++ b/tests/test_fixtures/rule_based_profiler/alice_user_workflow_verbose_profiler_config.yml
@@ -36,7 +36,7 @@ rules:
       - expectation_type: expect_column_values_to_be_between
         class_name: DefaultExpectationConfigurationBuilder
         module_name: great_expectations.rule_based_profiler.expectation_configuration_builder
-        min_value: $parameter.my_min_user_id.value[0]
+        min_value: $parameter.my_min_user_id.value[-1]
         max_value: $variables.max_user_id
         column: $domain.domain_kwargs.column
       - expectation_type: expect_column_values_to_not_be_null
@@ -46,17 +46,17 @@ rules:
       - expectation_type: expect_column_values_to_be_between
         class_name: DefaultExpectationConfigurationBuilder
         module_name: great_expectations.rule_based_profiler.expectation_configuration_builder
-        min_value: $parameter.my_min_user_id.value[0]
+        min_value: $parameter.my_min_user_id.value[-1]
         max_value: $variables.max_user_id
         column: $domain.domain_kwargs.column
-        condition: $parameter.my_min_user_id.value[0]>0
+        condition: $parameter.my_min_user_id.value[-1] > 0
       - expectation_type: expect_column_values_to_be_between
         class_name: DefaultExpectationConfigurationBuilder
         module_name: great_expectations.rule_based_profiler.expectation_configuration_builder
-        min_value: $parameter.my_min_user_id.value[0]
+        min_value: $parameter.my_min_user_id.value[-1]
         max_value: $variables.max_user_id
         column: $domain.domain_kwargs.column
-        condition: $parameter.my_min_user_id.value[0]>0 & $variables.max_user_id>0
+        condition: $parameter.my_min_user_id.value[-1] > 0 & $variables.max_user_id > 0
   my_rule_for_timestamps:
     domain_builder:
       class_name: SimpleColumnSuffixDomainBuilder
@@ -126,7 +126,7 @@ rules:
         module_name: great_expectations.rule_based_profiler.expectation_configuration_builder
         column: $domain.domain_kwargs.column
         min_value: $variables.min_timestamp
-        max_value: $parameter.my_max_event_ts.value[0]
+        max_value: $parameter.my_max_event_ts.value[-1]
         meta:
           notes:
             format: markdown