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_state.py b/great_expectations/rule_based_profiler/rule_state.py
--- a/great_expectations/rule_based_profiler/rule_state.py
+++ b/great_expectations/rule_based_profiler/rule_state.py
@@ -23,26 +23,26 @@ class RuleState:
     def __init__(
         self,
         rule: Optional[Rule] = None,
-        variables: Optional[ParameterContainer] = None,
         domains: Optional[List[Domain]] = None,
+        variables: Optional[ParameterContainer] = None,
         parameters: Optional[Dict[str, ParameterContainer]] = None,
     ) -> None:
         """
         Args:
             rule: Rule object for which present RuleState object corresponds (needed for various Rule properties).
-            variables: attribute name/value pairs (part of state, relevant for associated Rule).
             domains: List of Domain objects, which DomainBuilder of associated Rule generated.
+            variables: attribute name/value pairs (part of state, relevant for associated Rule).
             parameters: Dictionary of ParameterContainer objects corresponding to all Domain objects in memory.
         """
         self._rule = rule
 
-        self._variables = variables
-
         if domains is None:
             domains = []
 
         self._domains = domains
 
+        self._variables = variables
+
         if parameters is None:
             parameters = {}
 
@@ -59,14 +59,6 @@ def rule(self) -> Optional[Rule]:
     def rule(self, value: Rule) -> None:
         self._rule = value
 
-    @property
-    def variables(self) -> Optional[ParameterContainer]:
-        return self._variables
-
-    @variables.setter
-    def variables(self, value: Optional[ParameterContainer]) -> None:
-        self._variables = value
-
     @property
     def domains(self) -> List[Domain]:
         return self._domains
@@ -75,6 +67,14 @@ def domains(self) -> List[Domain]:
     def domains(self, value: Optional[List[Domain]]) -> None:
         self._domains = value
 
+    @property
+    def variables(self) -> Optional[ParameterContainer]:
+        return self._variables
+
+    @variables.setter
+    def variables(self, value: Optional[ParameterContainer]) -> None:
+        self._variables = value
+
     @property
     def parameters(self) -> Dict[str, ParameterContainer]:
         return self._parameters
@@ -123,6 +123,7 @@ def add_domain(
 or call "RuleState.remove_domain_if_exists()" with Domain having ID equal to "{domain.id}" as argument first.
 """
             )
+
         self.domains.append(domain)
 
     def remove_domain_if_exists(self, domain: Domain) -> None:


Test patch:
diff --git a/tests/rule_based_profiler/conftest.py b/tests/rule_based_profiler/conftest.py
--- a/tests/rule_based_profiler/conftest.py
+++ b/tests/rule_based_profiler/conftest.py
@@ -441,6 +441,7 @@ def rule_state_with_domains_and_parameters(
             column_Age_domain,
             column_Date_domain,
         ],
+        variables=None,
         parameters={
             column_Age_domain.id: single_part_name_parameter_container,
             column_Date_domain.id: multi_part_name_parameter_container,