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/helpers/simple_semantic_type_filter.py b/great_expectations/rule_based_profiler/helpers/simple_semantic_type_filter.py
--- a/great_expectations/rule_based_profiler/helpers/simple_semantic_type_filter.py
+++ b/great_expectations/rule_based_profiler/helpers/simple_semantic_type_filter.py
@@ -55,12 +55,12 @@ def parse_semantic_domain_type_argument(
             return [
                 SemanticDomainTypes(semantic_type) for semantic_type in [semantic_types]
             ]
+
         if isinstance(semantic_types, SemanticDomainTypes):
             return [semantic_type for semantic_type in [semantic_types]]
-        elif isinstance(semantic_types, list):
-            if all(
-                [isinstance(semantic_type, str) for semantic_type in semantic_types]
-            ):
+
+        if isinstance(semantic_types, list):
+            if all(isinstance(semantic_type, str) for semantic_type in semantic_types):
                 semantic_types = [
                     semantic_type.lower() for semantic_type in semantic_types
                 ]
@@ -68,19 +68,18 @@ def parse_semantic_domain_type_argument(
                     SemanticDomainTypes(semantic_type)
                     for semantic_type in semantic_types
                 ]
-            elif all(
-                [
-                    isinstance(semantic_type, SemanticDomainTypes)
-                    for semantic_type in semantic_types
-                ]
+
+            if all(
+                isinstance(semantic_type, SemanticDomainTypes)
+                for semantic_type in semantic_types
             ):
                 return [semantic_type for semantic_type in semantic_types]
-            else:
-                raise ValueError(
-                    "All elements in semantic_types list must be either of str or SemanticDomainTypes type."
-                )
-        else:
-            raise ValueError("Unrecognized semantic_types directive.")
+
+            raise ValueError(
+                "All elements in semantic_types list must be either of str or SemanticDomainTypes type."
+            )
+
+        raise ValueError("Unrecognized semantic_types directive.")
 
     def _build_table_column_name_to_inferred_semantic_domain_type_map(
         self,
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
@@ -992,18 +992,18 @@ def graph_validate(
         else:
             catch_exceptions = False
 
-        expectation_validation_graphs: List[ExpectationValidationGraph] = []
+        expectation_validation_graphs: List[ExpectationValidationGraph]
 
         evrs: List[ExpectationValidationResult]
 
         processed_configurations: List[ExpectationConfiguration] = []
 
         (
+            expectation_validation_graphs,
             evrs,
             processed_configurations,
         ) = self._generate_metric_dependency_subgraphs_for_each_expectation_configuration(
             expectation_configurations=configurations,
-            expectation_validation_graphs=expectation_validation_graphs,
             processed_configurations=processed_configurations,
             catch_exceptions=catch_exceptions,
             runtime_configuration=runtime_configuration,
@@ -1071,13 +1071,17 @@ def graph_validate(
     def _generate_metric_dependency_subgraphs_for_each_expectation_configuration(
         self,
         expectation_configurations: List[ExpectationConfiguration],
-        expectation_validation_graphs: List[ExpectationValidationGraph],
         processed_configurations: List[ExpectationConfiguration],
         catch_exceptions: bool,
         runtime_configuration: Optional[dict] = None,
-    ) -> Tuple[List[ExpectationValidationResult], List[ExpectationConfiguration]]:
+    ) -> Tuple[
+        List[ExpectationValidationGraph],
+        List[ExpectationValidationResult],
+        List[ExpectationConfiguration],
+    ]:
         # While evaluating expectation configurations, create sub-graph for every metric dependency and incorporate
         # these sub-graphs under corresponding expectation-level sub-graph (state of ExpectationValidationGraph object).
+        expectation_validation_graphs: List[ExpectationValidationGraph] = []
         evrs: List[ExpectationValidationResult] = []
         configuration: ExpectationConfiguration
         evaluated_config: ExpectationConfiguration
@@ -1140,7 +1144,7 @@ def _generate_metric_dependency_subgraphs_for_each_expectation_configuration(
                 else:
                     raise err
 
-        return evrs, processed_configurations
+        return expectation_validation_graphs, evrs, processed_configurations
 
     def _generate_suite_level_graph_from_expectation_level_sub_graphs(
         self,


Test patch: