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/profiler.py b/great_expectations/rule_based_profiler/profiler.py
--- a/great_expectations/rule_based_profiler/profiler.py
+++ b/great_expectations/rule_based_profiler/profiler.py
@@ -1,5 +1,5 @@
 import uuid
-from typing import Dict, List, Optional
+from typing import Dict, List, Optional, Union
 
 import great_expectations.exceptions as ge_exceptions
 from great_expectations import DataContext
@@ -30,8 +30,7 @@ class Profiler:
     def __init__(
         self,
         *,
-        variables_configs: Optional[Dict[str, Dict]] = None,
-        rules_configs: Optional[Dict[str, Dict]] = None,
+        profiler_config: Optional[Dict[str, Dict[str, Dict]]] = None,
         data_context: Optional[DataContext] = None,
     ):
         """
@@ -46,11 +45,12 @@ def __init__(
             data_context: DataContext object that defines a full runtime environment (data access, etc.)
         """
         self._data_context = data_context
-
         self._rules = []
 
+        rules_configs: Dict[str, Dict] = profiler_config.get("rules", {})
         rule_name: str
         rule_config: dict
+
         for rule_name, rule_config in rules_configs.items():
             domain_builder_config: dict = rule_config.get("domain_builder")
 
@@ -108,7 +108,9 @@ def __init__(
                         )
                     )
 
+            variables_configs: Dict[str, Dict] = profiler_config.get("variables", {})
             variables: Optional[ParameterContainer] = None
+
             if variables_configs:
                 variables = build_parameter_container_for_variables(
                     variables_configs=variables_configs


Test patch:
diff --git a/tests/rule_based_profiler/test_profiler_user_workflows.py b/tests/rule_based_profiler/test_profiler_user_workflows.py
--- a/tests/rule_based_profiler/test_profiler_user_workflows.py
+++ b/tests/rule_based_profiler/test_profiler_user_workflows.py
@@ -73,16 +73,13 @@ def test_alice_profiler_user_workflow_single_batch(
     # Load data context
     data_context: DataContext = alice_columnar_table_single_batch_context
     # Load profiler configs & loop (run tests for each one)
-    profiler_config: str = alice_columnar_table_single_batch["profiler_config"]
+    yaml_config: str = alice_columnar_table_single_batch["profiler_config"]
 
     # Instantiate Profiler
-    full_profiler_config_dict: dict = yaml.load(profiler_config)
-    rules_configs: dict = full_profiler_config_dict.get("rules")
-    variables_configs: dict = full_profiler_config_dict.get("variables")
+    profiler_config: dict = yaml.load(yaml_config)
 
     profiler: Profiler = Profiler(
-        rules_configs=rules_configs,
-        variables_configs=variables_configs,
+        profiler_config=profiler_config,
         data_context=data_context,
     )
 
@@ -171,16 +168,13 @@ def test_bobby_profiler_user_workflow_multi_batch(
     # Load data context
     data_context: DataContext = bobby_columnar_table_multi_batch_context
     # Load profiler configs & loop (run tests for each one)
-    profiler_config: str = bobby_columnar_table_multi_batch["profiler_config"]
+    yaml_config: str = bobby_columnar_table_multi_batch["profiler_config"]
 
     # Instantiate Profiler
-    full_profiler_config_dict: dict = yaml.load(profiler_config)
-    rules_configs: dict = full_profiler_config_dict.get("rules")
-    variables_configs: dict = full_profiler_config_dict.get("variables")
+    profiler_config: dict = yaml.load(yaml_config)
 
     profiler: Profiler = Profiler(
-        rules_configs=rules_configs,
-        variables_configs=variables_configs,
+        profiler_config=profiler_config,
         data_context=data_context,
     )