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/config/base.py b/great_expectations/rule_based_profiler/config/base.py
--- a/great_expectations/rule_based_profiler/config/base.py
+++ b/great_expectations/rule_based_profiler/config/base.py
@@ -295,11 +295,11 @@ class Meta:
 class RuleConfig(SerializableDictDot):
     def __init__(
         self,
-        expectation_configuration_builders: List[
-            dict
-        ],  # see ExpectationConfigurationBuilderConfig
         domain_builder: Optional[dict] = None,  # see DomainBuilderConfig
         parameter_builders: Optional[List[dict]] = None,  # see ParameterBuilderConfig
+        expectation_configuration_builders: Optional[
+            List[dict]
+        ] = None,  # see ExpectationConfigurationBuilderConfig
     ):
         self.domain_builder = domain_builder
         self.parameter_builders = parameter_builders
@@ -375,8 +375,8 @@ class Meta:
             required=True,
             allow_none=False,
         ),
-        required=True,
-        allow_none=False,
+        required=False,
+        allow_none=True,
     )
 
 
diff --git a/great_expectations/rule_based_profiler/rule/rule.py b/great_expectations/rule_based_profiler/rule/rule.py
--- a/great_expectations/rule_based_profiler/rule/rule.py
+++ b/great_expectations/rule_based_profiler/rule/rule.py
@@ -25,8 +25,10 @@ def __init__(
         self,
         name: str,
         domain_builder: DomainBuilder,
-        expectation_configuration_builders: List[ExpectationConfigurationBuilder],
         parameter_builders: Optional[List[ParameterBuilder]] = None,
+        expectation_configuration_builders: Optional[
+            List[ExpectationConfigurationBuilder]
+        ] = None,
     ):
         """
         Sets Profiler rule name, domain builders, parameters builders, configuration builders,
@@ -130,7 +132,7 @@ def parameter_builders(self) -> Optional[List[ParameterBuilder]]:
     @property
     def expectation_configuration_builders(
         self,
-    ) -> List[ExpectationConfigurationBuilder]:
+    ) -> Optional[List[ExpectationConfigurationBuilder]]:
         return self._expectation_configuration_builders
 
     @property
@@ -225,8 +227,14 @@ def _get_parameter_builders_as_dict(self) -> Dict[str, ParameterBuilder]:
     def _get_expectation_configuration_builders_as_dict(
         self,
     ) -> Dict[str, ExpectationConfigurationBuilder]:
+        expectation_configuration_builders: List[
+            ExpectationConfigurationBuilder
+        ] = self.expectation_configuration_builders
+        if expectation_configuration_builders is None:
+            expectation_configuration_builders = []
+
         expectation_configuration_builder: ExpectationConfigurationBuilder
         return {
             expectation_configuration_builder.expectation_type: expectation_configuration_builder
-            for expectation_configuration_builder in self.expectation_configuration_builders
+            for expectation_configuration_builder in expectation_configuration_builders
         }


Test patch:
diff --git a/tests/rule_based_profiler/config/test_base.py b/tests/rule_based_profiler/config/test_base.py
--- a/tests/rule_based_profiler/config/test_base.py
+++ b/tests/rule_based_profiler/config/test_base.py
@@ -178,13 +178,12 @@ def test_rule_config_unsuccessfully_loads_with_missing_required_fields():
     data = {}
     schema = RuleConfigSchema()
 
-    with pytest.raises(ValidationError) as e:
-        schema.load(data)
+    config = schema.load(data)
 
-    assert (
-        "'expectation_configuration_builders': ['Missing data for required field.']"
-        in str(e.value)
-    )
+    assert isinstance(config, RuleConfig)
+    assert config.domain_builder is None
+    assert config.parameter_builders is None
+    assert config.expectation_configuration_builders is None
 
 
 def test_rule_based_profiler_config_successfully_loads_with_required_args():
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
@@ -117,8 +117,6 @@ def column_Description_domain():
 # noinspection PyPep8Naming
 @pytest.fixture
 def column_pair_Age_Date_domain():
-    skip_if_python_below_minimum_version()
-
     return Domain(
         domain_type=MetricDomainTypes.COLUMN_PAIR,
         domain_kwargs={
@@ -132,8 +130,6 @@ def column_pair_Age_Date_domain():
 # noinspection PyPep8Naming
 @pytest.fixture
 def multi_column_Age_Date_Description_domain():
-    skip_if_python_below_minimum_version()
-
     return Domain(
         domain_type=MetricDomainTypes.MULTICOLUMN,
         domain_kwargs={