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/self_check/util.py b/great_expectations/self_check/util.py
--- a/great_expectations/self_check/util.py
+++ b/great_expectations/self_check/util.py
@@ -1231,7 +1231,6 @@ def candidate_test_is_on_temporary_notimplemented_list(context, expectation_type
 def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_type):
     if context in ["sqlite", "postgresql", "mysql", "mssql"]:
         return expectation_type in [
-            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_values_to_be_increasing",
             "expect_column_values_to_be_decreasing",
             "expect_column_values_to_match_strftime_format",
@@ -1248,13 +1247,14 @@ def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_
             # "expect_column_pair_values_A_to_be_greater_than_B",
             # "expect_column_pair_values_to_be_equal",
             # "expect_column_pair_values_to_be_in_set",
-            "expect_multicolumn_values_to_be_unique",
             # "expect_multicolumn_sum_to_equal",
+            # "expect_compound_columns_to_be_unique",
+            "expect_multicolumn_values_to_be_unique",
+            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_pair_cramers_phi_value_to_be_less_than",
             "expect_column_bootstrapped_ks_test_p_value_to_be_greater_than",
             "expect_column_chisquare_test_p_value_to_be_greater_than",
             "expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than",
-            "expect_compound_columns_to_be_unique",
         ]
 
     if context == "bigquery":
@@ -1276,7 +1276,6 @@ def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_
             "expect_column_values_to_be_between",  # TODO: "400 No matching signature for operator >=" -- https://github.com/great-expectations/great_expectations/issues/3260
             "expect_column_quantile_values_to_be_between",  # TODO: takes over 15 minutes to "collect" (haven't actually seen it complete yet) -- https://github.com/great-expectations/great_expectations/issues/3260
             "expect_column_mean_to_be_between",  # TODO: "400 No matching signature for operator *" -- https://github.com/great-expectations/great_expectations/issues/3260
-            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_values_to_be_increasing",
             "expect_column_values_to_be_decreasing",
             "expect_column_values_to_match_strftime_format",
@@ -1287,17 +1286,17 @@ def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_
             # "expect_column_pair_values_A_to_be_greater_than_B",
             # "expect_column_pair_values_to_be_equal",
             # "expect_column_pair_values_to_be_in_set",
-            "expect_multicolumn_values_to_be_unique",
             # "expect_multicolumn_sum_to_equal",
+            # "expect_compound_columns_to_be_unique",
+            "expect_multicolumn_values_to_be_unique",
+            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_pair_cramers_phi_value_to_be_less_than",
             "expect_column_bootstrapped_ks_test_p_value_to_be_greater_than",
             "expect_column_chisquare_test_p_value_to_be_greater_than",
             "expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than",
-            "expect_compound_columns_to_be_unique",
         ]
     if context == "spark":
         return expectation_type in [
-            # "expect_select_column_values_to_be_unique_within_record",
             "expect_table_row_count_to_equal_other_table",
             "expect_column_values_to_be_in_set",
             "expect_column_values_to_not_be_in_set",
@@ -1310,9 +1309,10 @@ def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_
             # "expect_column_pair_values_A_to_be_greater_than_B",
             # "expect_column_pair_values_to_be_equal",
             # "expect_column_pair_values_to_be_in_set",
+            # "expect_multicolumn_sum_to_equal",
             # "expect_compound_columns_to_be_unique",
             "expect_multicolumn_values_to_be_unique",
-            # "expect_multicolumn_sum_to_equal",
+            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_pair_cramers_phi_value_to_be_less_than",
             "expect_column_bootstrapped_ks_test_p_value_to_be_greater_than",
             "expect_column_chisquare_test_p_value_to_be_greater_than",
@@ -1345,9 +1345,10 @@ def candidate_test_is_on_temporary_notimplemented_list_cfe(context, expectation_
             # "expect_column_pair_values_A_to_be_greater_than_B",
             # "expect_column_pair_values_to_be_equal",
             # "expect_column_pair_values_to_be_in_set",
-            # "expect_select_column_values_to_be_unique_within_record",
+            # "expect_multicolumn_sum_to_equal",
             # "expect_compound_columns_to_be_unique",
             "expect_multicolumn_values_to_be_unique",
+            # "expect_select_column_values_to_be_unique_within_record",
             "expect_column_pair_cramers_phi_value_to_be_less_than",
             "expect_column_bootstrapped_ks_test_p_value_to_be_greater_than",
             "expect_column_chisquare_test_p_value_to_be_greater_than",


Test patch:
diff --git a/tests/test_definitions/multicolumn_map_expectations/expect_compound_columns_to_be_unique.json b/tests/test_definitions/multicolumn_map_expectations/expect_compound_columns_to_be_unique.json
--- a/tests/test_definitions/multicolumn_map_expectations/expect_compound_columns_to_be_unique.json
+++ b/tests/test_definitions/multicolumn_map_expectations/expect_compound_columns_to_be_unique.json
@@ -63,8 +63,9 @@
         }
       }
     },{
-      "title": "unexpected_values",
+      "title": "unexpected_values_with_unexpected_index_list",
       "exact_match_out" : false,
+      "only_for": ["pandas"],
       "in": {
         "column_list": ["a", "b"]
       },
@@ -110,6 +111,53 @@
         "unexpected_index_list": [0,1,2,3,4,5,6,7,8],
         "success": false
       }
+    },{
+      "title": "unexpected_values_without_unexpected_index_list",
+      "exact_match_out" : false,
+      "in": {
+        "column_list": ["a", "b"]
+      },
+      "out": {
+        "unexpected_list": [
+          {
+            "a": 1.0,
+            "b": 1.0
+          },
+          {
+            "a": 1.0,
+            "b": 2.0
+          },
+          {
+            "a": 1.0,
+            "b": 1.0
+          },
+          {
+            "a": 1.0,
+            "b": 2.0
+          },
+          {
+            "a": 1.0,
+            "b": 1.0
+          },
+          {
+            "a": 2.0,
+            "b": 2.0
+          },
+          {
+            "a": 2.0,
+            "b": 1.0
+          },
+          {
+            "a": 2.0,
+            "b": 2.0
+          },
+          {
+            "a": 2.0,
+            "b": 1.0
+          }
+        ],
+        "success": false
+      }
     },{
       "title": "unexpected_values_exact_match_out_with_unexpected_index_list",
       "exact_match_out" : true,
@@ -213,7 +261,6 @@
     },{
       "title": "unexpected_values_exact_match_out_without_unexpected_index_list",
       "exact_match_out" : true,
-      "suppress_test_for": ["pandas"],
       "in": {
         "column_list": ["a", "b"]
       },