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/util.py b/great_expectations/util.py
--- a/great_expectations/util.py
+++ b/great_expectations/util.py
@@ -26,7 +26,7 @@
 )
 from pathlib import Path
 from types import CodeType, FrameType, ModuleType
-from typing import Any, Callable, Optional, Union
+from typing import Any, Callable, Optional, Set, Union
 
 from dateutil.parser import parse
 from packaging import version
@@ -933,8 +933,8 @@ def lint_code(code: str) -> str:
 
 def filter_properties_dict(
     properties: dict,
-    keep_fields: Optional[list] = None,
-    delete_fields: Optional[list] = None,
+    keep_fields: Optional[Set[str]] = None,
+    delete_fields: Optional[Set[str]] = None,
     clean_nulls: Optional[bool] = True,
     clean_falsy: Optional[bool] = False,
     keep_falsy_numerics: Optional[bool] = True,


Test patch:
diff --git a/tests/data_asset/test_data_asset_citations.py b/tests/data_asset/test_data_asset_citations.py
--- a/tests/data_asset/test_data_asset_citations.py
+++ b/tests/data_asset/test_data_asset_citations.py
@@ -7,7 +7,9 @@ def test_data_asset_citations(pandas_dataset):
     suite = pandas_dataset.get_expectation_suite()
     assert filter_properties_dict(
         properties=suite.meta["citations"][0],
-        delete_fields=["interactive"],
+        delete_fields={
+            "interactive",
+        },
         clean_falsy=True,
     ) == filter_properties_dict(
         properties={
diff --git a/tests/test_ge_utils.py b/tests/test_ge_utils.py
--- a/tests/test_ge_utils.py
+++ b/tests/test_ge_utils.py
@@ -281,8 +281,13 @@ def test_filter_properties_dict():
         # noinspection PyUnusedLocal
         d0_end: dict = filter_properties_dict(
             properties=d0_begin,
-            keep_fields=["string"],
-            delete_fields=["integer_zero", "scientific_notation_floating_point_number"],
+            keep_fields={
+                "string",
+            },
+            delete_fields={
+                "integer_zero",
+                "scientific_notation_floating_point_number",
+            },
             clean_falsy=True,
         )
     d0_end: dict = filter_properties_dict(properties=d0_begin, clean_falsy=True)
@@ -311,7 +316,9 @@ def test_filter_properties_dict():
     d3_begin: dict = copy.deepcopy(source_dict)
     d3_end: dict = filter_properties_dict(
         properties=d3_begin,
-        keep_fields=["null"],
+        keep_fields={
+            "null",
+        },
         clean_falsy=True,
     )
     d3_end_expected = {"null": None}
@@ -331,7 +338,10 @@ def test_filter_properties_dict():
     d5_begin: dict = copy.deepcopy(source_dict)
     d5_end: dict = filter_properties_dict(
         properties=d5_begin,
-        keep_fields=["integer_zero", "scientific_notation_floating_point_number"],
+        keep_fields={
+            "integer_zero",
+            "scientific_notation_floating_point_number",
+        },
         clean_falsy=True,
     )
     d5_end_expected = {
@@ -343,7 +353,10 @@ def test_filter_properties_dict():
     d6_begin: dict = copy.deepcopy(source_dict)
     d6_end: dict = filter_properties_dict(
         properties=d6_begin,
-        delete_fields=["integer_zero", "scientific_notation_floating_point_number"],
+        delete_fields={
+            "integer_zero",
+            "scientific_notation_floating_point_number",
+        },
         clean_falsy=True,
     )
     d6_end_expected = {"string": "xyz_0", "integer_one": 1}
@@ -352,7 +365,10 @@ def test_filter_properties_dict():
     d7_begin: dict = copy.deepcopy(source_dict)
     filter_properties_dict(
         properties=d7_begin,
-        delete_fields=["integer_zero", "scientific_notation_floating_point_number"],
+        delete_fields={
+            "integer_zero",
+            "scientific_notation_floating_point_number",
+        },
         clean_falsy=True,
         inplace=True,
     )