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/data_context/data_context/abstract_data_context.py b/great_expectations/data_context/data_context/abstract_data_context.py
--- a/great_expectations/data_context/data_context/abstract_data_context.py
+++ b/great_expectations/data_context/data_context/abstract_data_context.py
@@ -2028,10 +2028,14 @@ def get_checkpoint(
             The requested Checkpoint.
 
         Raises:
-            CheckpointNotFoundError: If the requested Checkpoint does not exists.
+            CheckpointNotFoundError: If the requested Checkpoint does not exist.
         """
         # <GX_RENAME>
         id = self._resolve_id_and_ge_cloud_id(id=id, ge_cloud_id=ge_cloud_id)
+
+        if not name and not id:
+            raise ValueError("name and id cannot both be None")
+
         del ge_cloud_id
 
         from great_expectations.checkpoint.checkpoint import Checkpoint
@@ -2067,7 +2071,7 @@ def delete_checkpoint(
             id: The id associated with the target Checkpoint (preferred over `ge_cloud_id`).
 
         Raises:
-            CheckpointNotFoundError: If the requested Checkpoint does not exists.
+            CheckpointNotFoundError: If the requested Checkpoint does not exist.
         """
         # <GX_RENAME>
         id = self._resolve_id_and_ge_cloud_id(id=id, ge_cloud_id=ge_cloud_id)
diff --git a/great_expectations/data_context/data_context/cloud_data_context.py b/great_expectations/data_context/data_context/cloud_data_context.py
--- a/great_expectations/data_context/data_context/cloud_data_context.py
+++ b/great_expectations/data_context/data_context/cloud_data_context.py
@@ -566,6 +566,11 @@ def get_expectation_suite(
         Returns:
             An existing ExpectationSuite
         """
+        if ge_cloud_id is None and expectation_suite_name is None:
+            raise ValueError(
+                "ge_cloud_id and expectation_suite_name cannot both be None"
+            )
+
         key = GXCloudIdentifier(
             resource_type=GXCloudRESTResource.EXPECTATION_SUITE,
             cloud_id=ge_cloud_id,


Test patch:
diff --git a/tests/cli/conftest.py b/tests/cli/conftest.py
--- a/tests/cli/conftest.py
+++ b/tests/cli/conftest.py
@@ -39,6 +39,7 @@ def v10_project_directory(tmp_path_factory):
     """
     GX 0.10.x project for testing upgrade helper
     """
+
     project_path = str(tmp_path_factory.mktemp("v10_project"))
     context_root_dir = os.path.join(project_path, "great_expectations")
     shutil.copytree(
diff --git a/tests/data_context/cloud_data_context/test_checkpoint_crud.py b/tests/data_context/cloud_data_context/test_checkpoint_crud.py
--- a/tests/data_context/cloud_data_context/test_checkpoint_crud.py
+++ b/tests/data_context/cloud_data_context/test_checkpoint_crud.py
@@ -192,6 +192,17 @@ def test_cloud_backed_data_context_get_checkpoint_by_name(
     assert checkpoint.validations[1]["id"] == validation_id_2
 
 
+@pytest.mark.cloud
+@pytest.mark.unit
+def test_get_checkpoint_no_identifier_raises_error(
+    empty_cloud_data_context: CloudDataContext,
+) -> None:
+    context = empty_cloud_data_context
+
+    with pytest.raises(ValueError):
+        checkpoint = context.get_checkpoint()
+
+
 @pytest.mark.cloud
 @pytest.mark.integration
 def test_cloud_backed_data_context_add_checkpoint(
diff --git a/tests/data_context/cloud_data_context/test_expectation_suite_crud.py b/tests/data_context/cloud_data_context/test_expectation_suite_crud.py
--- a/tests/data_context/cloud_data_context/test_expectation_suite_crud.py
+++ b/tests/data_context/cloud_data_context/test_expectation_suite_crud.py
@@ -439,6 +439,17 @@ def test_get_expectation_suite_nonexistent_suite_raises_error(
             context.get_expectation_suite(ge_cloud_id=suite_id)
 
 
+@pytest.mark.unit
+@pytest.mark.cloud
+def test_get_expectation_suite_no_identifier_raises_error(
+    empty_base_data_context_in_cloud_mode: CloudDataContext,
+) -> None:
+    context = empty_base_data_context_in_cloud_mode
+
+    with pytest.raises(ValueError):
+        context.get_expectation_suite()
+
+
 @pytest.mark.unit
 @pytest.mark.cloud
 def test_save_expectation_suite_saves_suite_to_cloud(