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/execution_engine/pandas_execution_engine.py b/great_expectations/execution_engine/pandas_execution_engine.py
--- a/great_expectations/execution_engine/pandas_execution_engine.py
+++ b/great_expectations/execution_engine/pandas_execution_engine.py
@@ -412,8 +412,11 @@ class MetricDomainTypes.
 
         # Checking if table or identity or other provided, column is not specified. If it is, warning the user
         elif domain_type == MetricDomainTypes.MULTICOLUMN:
-            if "columns" in compute_domain_kwargs:
-                accessor_domain_kwargs["columns"] = compute_domain_kwargs.pop("columns")
+            if "column_list" in compute_domain_kwargs:
+                # If column_list exists
+                accessor_domain_kwargs["column_list"] = compute_domain_kwargs.pop(
+                    "column_list"
+                )
 
         # Filtering if identity
         elif domain_type == MetricDomainTypes.IDENTITY:
@@ -438,8 +441,8 @@ class MetricDomainTypes.
 
             else:
                 # If we would like our data to become a multicolumn
-                if "columns" in compute_domain_kwargs:
-                    data = data[compute_domain_kwargs["columns"]]
+                if "column_list" in compute_domain_kwargs:
+                    data = data[compute_domain_kwargs["column_list"]]
 
         return data, compute_domain_kwargs, accessor_domain_kwargs
 
diff --git a/great_expectations/execution_engine/sparkdf_execution_engine.py b/great_expectations/execution_engine/sparkdf_execution_engine.py
--- a/great_expectations/execution_engine/sparkdf_execution_engine.py
+++ b/great_expectations/execution_engine/sparkdf_execution_engine.py
@@ -443,9 +443,11 @@ class MetricDomainTypes.
 
         # Checking if table or identity or other provided, column is not specified. If it is, warning the user
         elif domain_type == MetricDomainTypes.MULTICOLUMN:
-            if "columns" in compute_domain_kwargs:
-                # If columns exist
-                accessor_domain_kwargs["columns"] = compute_domain_kwargs.pop("columns")
+            if "column_list" in compute_domain_kwargs:
+                # If column_list exists
+                accessor_domain_kwargs["column_list"] = compute_domain_kwargs.pop(
+                    "column_list"
+                )
 
         # Filtering if identity
         elif domain_type == MetricDomainTypes.IDENTITY:
@@ -464,8 +466,8 @@ class MetricDomainTypes.
             else:
 
                 # If we would like our data to become a multicolumn
-                if "columns" in compute_domain_kwargs:
-                    data = data.select(compute_domain_kwargs["columns"])
+                if "column_list" in compute_domain_kwargs:
+                    data = data.select(compute_domain_kwargs["column_list"])
 
         return data, compute_domain_kwargs, accessor_domain_kwargs
 
diff --git a/great_expectations/execution_engine/sqlalchemy_execution_engine.py b/great_expectations/execution_engine/sqlalchemy_execution_engine.py
--- a/great_expectations/execution_engine/sqlalchemy_execution_engine.py
+++ b/great_expectations/execution_engine/sqlalchemy_execution_engine.py
@@ -523,9 +523,11 @@ class MetricDomainTypes.
 
         # Checking if table or identity or other provided, column is not specified. If it is, warning the user
         elif domain_type == MetricDomainTypes.MULTICOLUMN:
-            if "columns" in compute_domain_kwargs:
-                # If columns exist
-                accessor_domain_kwargs["columns"] = compute_domain_kwargs.pop("columns")
+            if "column_list" in compute_domain_kwargs:
+                # If column_list exists
+                accessor_domain_kwargs["column_list"] = compute_domain_kwargs.pop(
+                    "column_list"
+                )
 
         # Filtering if identity
         elif domain_type == MetricDomainTypes.IDENTITY:
@@ -560,17 +562,18 @@ class MetricDomainTypes.
                     ).select_from(selectable)
             else:
                 # If we would like our data to become a multicolumn
-                if "columns" in compute_domain_kwargs:
+                if "column_list" in compute_domain_kwargs:
                     if self.active_batch_data.use_quoted_name:
                         # Building a list of column objects used for sql alchemy selection
                         to_select = [
                             sa.column(quoted_name(col))
-                            for col in compute_domain_kwargs["columns"]
+                            for col in compute_domain_kwargs["column_list"]
                         ]
                         selectable = sa.select(to_select).select_from(selectable)
                     else:
                         to_select = [
-                            sa.column(col) for col in compute_domain_kwargs["columns"]
+                            sa.column(col)
+                            for col in compute_domain_kwargs["column_list"]
                         ]
                         selectable = sa.select(to_select).select_from(selectable)
 


Test patch:
diff --git a/tests/execution_engine/test_pandas_execution_engine.py b/tests/execution_engine/test_pandas_execution_engine.py
--- a/tests/execution_engine/test_pandas_execution_engine.py
+++ b/tests/execution_engine/test_pandas_execution_engine.py
@@ -118,23 +118,23 @@ def test_get_compute_domain_with_multicolumn_domain():
     # Loading batch data
     engine.load_batch_data(batch_data=df, batch_id="1234")
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="multicolumn"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="multicolumn"
     )
     assert data.equals(df), "Data does not match after getting compute domain"
     assert compute_kwargs == {}, "Compute domain kwargs should be existent"
     assert accessor_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Accessor kwargs have been modified"
 
     # Trying same test with enum form of table domain - should work the same way
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="identity"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="identity"
     )
     assert data.equals(
         expected_identity
     ), "Data does not match after getting compute domain"
     assert compute_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Compute domain kwargs should be existent"
     assert accessor_kwargs == {}, "Accessor kwargs have been modified"
 
diff --git a/tests/execution_engine/test_sparkdf_execution_engine.py b/tests/execution_engine/test_sparkdf_execution_engine.py
--- a/tests/execution_engine/test_sparkdf_execution_engine.py
+++ b/tests/execution_engine/test_sparkdf_execution_engine.py
@@ -997,7 +997,7 @@ def test_get_compute_domain_with_multicolumn(
     df = engine.dataframe
 
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="multicolumn"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="multicolumn"
     )
 
     # Ensuring that with no domain nothing happens to the data itself
@@ -1006,13 +1006,13 @@ def test_get_compute_domain_with_multicolumn(
     ), "Data does not match after getting compute domain"
     assert compute_kwargs == {}, "Compute domain kwargs should be empty"
     assert accessor_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Accessor kwargs have been modified"
 
     # Checking for identity
     engine.load_batch_data(batch_data=df, batch_id="1234")
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="identity"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="identity"
     )
 
     # Ensuring that with no domain nothing happens to the data itself
@@ -1020,7 +1020,7 @@ def test_get_compute_domain_with_multicolumn(
         data, df
     ), "Data does not match after getting compute domain"
     assert compute_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Compute domain kwargs should not change for identity domain"
     assert accessor_kwargs == {}, "Accessor kwargs have been modified"
 
diff --git a/tests/execution_engine/test_sqlalchemy_execution_engine.py b/tests/execution_engine/test_sqlalchemy_execution_engine.py
--- a/tests/execution_engine/test_sqlalchemy_execution_engine.py
+++ b/tests/execution_engine/test_sqlalchemy_execution_engine.py
@@ -317,7 +317,7 @@ def test_get_compute_domain_with_multicolumn(sa):
 
     # Obtaining compute domain
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="multicolumn"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="multicolumn"
     )
 
     # Seeing if raw data is the same as the data after condition has been applied - checking post computation data
@@ -330,12 +330,12 @@ def test_get_compute_domain_with_multicolumn(sa):
     assert raw_data == domain_data, "Data does not match after getting compute domain"
     assert compute_kwargs is not None, "Compute domain kwargs should be existent"
     assert accessor_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Accessor kwargs have been modified"
 
     # Checking for identity
     data, compute_kwargs, accessor_kwargs = engine.get_compute_domain(
-        domain_kwargs={"columns": ["a", "b", "c"]}, domain_type="identity"
+        domain_kwargs={"column_list": ["a", "b", "c"]}, domain_type="identity"
     )
 
     # Seeing if raw data is the same as the data after condition has been applied - checking post computation data
@@ -349,7 +349,7 @@ def test_get_compute_domain_with_multicolumn(sa):
     # Ensuring that with no domain nothing happens to the data itself
     assert raw_data == domain_data, "Data does not match after getting compute domain"
     assert compute_kwargs == {
-        "columns": ["a", "b", "c"]
+        "column_list": ["a", "b", "c"]
     }, "Compute domain kwargs should be existent"
     assert accessor_kwargs == {}, "Accessor kwargs have been modified"