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/checkpoint/checkpoint.py b/great_expectations/checkpoint/checkpoint.py
--- a/great_expectations/checkpoint/checkpoint.py
+++ b/great_expectations/checkpoint/checkpoint.py
@@ -287,7 +287,6 @@ def run(
                     expectation_suite_ge_cloud_id: str = (
                         substituted_validation_dict.get("expectation_suite_ge_cloud_id")
                     )
-                    action_list: list = substituted_validation_dict.get("action_list")
 
                     validator: Validator = self.data_context.get_validator(
                         batch_request=batch_request,
diff --git a/great_expectations/checkpoint/util.py b/great_expectations/checkpoint/util.py
--- a/great_expectations/checkpoint/util.py
+++ b/great_expectations/checkpoint/util.py
@@ -1,11 +1,11 @@
 import copy
-import json
+import datetime
 import logging
 import smtplib
 import ssl
 from email.mime.multipart import MIMEMultipart
 from email.mime.text import MIMEText
-from typing import Optional, Union
+from typing import Optional
 
 import requests
 
@@ -54,9 +54,10 @@ def send_slack_notification(
             return "Slack notification succeeded."
 
 
+# noinspection SpellCheckingInspection
 def send_opsgenie_alert(query, suite_name, settings):
     """Creates an alert in Opsgenie."""
-    if settings["region"] != None:
+    if settings["region"] is not None:
         url = "https://api.{region}.opsgenie.com/v2/alerts".format(
             region=settings["region"]
         )  # accommodate for Europeans
@@ -157,6 +158,7 @@ def send_webhook_notifications(query, webhook, target_platform):
             )
 
 
+# noinspection SpellCheckingInspection
 def send_email(
     title,
     html,
@@ -175,7 +177,6 @@ def send_email(
     msg["Subject"] = title
     msg.attach(MIMEText(html, "html"))
     try:
-        mailserver = None
         if use_ssl:
             if use_tls:
                 logger.warning("Please choose between SSL or TLS, will default to SSL")
@@ -209,7 +210,7 @@ def get_runtime_batch_request(
     substituted_runtime_config: CheckpointConfig,
     validation_batch_request: Optional[dict] = None,
     ge_cloud_mode: bool = False,
-) -> Union[BatchRequest, RuntimeBatchRequest]:
+) -> Optional[BatchRequest]:
     runtime_config_batch_request = substituted_runtime_config.batch_request
     batch_data = None
     if isinstance(runtime_config_batch_request, RuntimeBatchRequest):
diff --git a/great_expectations/core/batch.py b/great_expectations/core/batch.py
--- a/great_expectations/core/batch.py
+++ b/great_expectations/core/batch.py
@@ -274,10 +274,16 @@ def to_json_dict(self) -> dict:
             json_dict["batch_identifiers"] = self.batch_identifiers
 
         if self.runtime_parameters is not None:
-            json_dict["runtime_parameters"] = self.runtime_parameters
-            if json_dict["runtime_parameters"].get("batch_data") is not None:
+            key: str
+            value: Any
+            json_dict["runtime_parameters"] = {
+                key: value
+                for key, value in self.runtime_parameters.items()
+                if key != "batch_data"
+            }
+            if self.runtime_parameters.get("batch_data") is not None:
                 json_dict["runtime_parameters"]["batch_data"] = str(
-                    type(json_dict["runtime_parameters"]["batch_data"])
+                    type(self.runtime_parameters.get("batch_data"))
                 )
 
         filter_properties_dict(properties=json_dict, clean_falsy=True, inplace=True)


Test patch:
diff --git a/tests/cli/test_checkpoint.py b/tests/cli/test_checkpoint.py
--- a/tests/cli/test_checkpoint.py
+++ b/tests/cli/test_checkpoint.py
@@ -3,7 +3,7 @@
 import shutil
 import subprocess
 import unittest
-from typing import List
+from typing import List, Optional
 from unittest import mock
 
 import nbformat
@@ -19,7 +19,11 @@
 from great_expectations.core import ExpectationSuite
 from great_expectations.data_context.types.base import DataContextConfigDefaults
 from great_expectations.data_context.util import file_relative_path
-from great_expectations.datasource import Datasource
+from great_expectations.datasource import (
+    Datasource,
+    LegacyDatasource,
+    SimpleSqlalchemyDatasource,
+)
 from tests.cli.utils import assert_no_logging_messages_or_tracebacks
 
 yaml = YAML()
@@ -65,7 +69,9 @@ def titanic_data_context_with_sql_datasource(
 
     try:
         # noinspection PyUnusedLocal
-        my_sql_datasource = context.add_datasource(
+        my_sql_datasource: Optional[
+            SimpleSqlalchemyDatasource, LegacyDatasource
+        ] = context.add_datasource(
             "test_sqlite_db_datasource", **yaml.load(datasource_config)
         )
     except AttributeError:
@@ -181,6 +187,7 @@ def titanic_data_context_with_spark_datasource(
     )
     df: pd.DataFrame = pd.read_csv(filepath_or_buffer=csv_path)
     df = df.sample(frac=0.5, replace=True, random_state=1)
+    # noinspection PyTypeChecker
     df.to_csv(path_or_buf=csv_path)
 
     csv_path: str = os.path.join(
@@ -206,6 +213,7 @@ def test_checkpoint_delete_with_non_existent_checkpoint(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint delete my_checkpoint",
@@ -220,7 +228,9 @@ def test_checkpoint_delete_with_non_existent_checkpoint(
     )
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -239,6 +249,9 @@ def test_checkpoint_delete_with_non_existent_checkpoint(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(caplog, result)
 
@@ -257,6 +270,7 @@ def test_checkpoint_delete_with_single_checkpoint_confirm_success(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint delete my_v1_checkpoint",
@@ -269,7 +283,9 @@ def test_checkpoint_delete_with_single_checkpoint_confirm_success(
     assert 'Checkpoint "my_v1_checkpoint" deleted.' in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -288,12 +304,16 @@ def test_checkpoint_delete_with_single_checkpoint_confirm_success(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
         result,
     )
 
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -318,6 +338,7 @@ def test_checkpoint_delete_with_single_checkpoint_assume_yes_flag(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
     runner: CliRunner = CliRunner(mix_stderr=False)
     checkpoint_name: str = "my_v1_checkpoint"
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api --assume-yes checkpoint delete {checkpoint_name}",
@@ -336,7 +357,9 @@ def test_checkpoint_delete_with_single_checkpoint_assume_yes_flag(
     assert 'Checkpoint "my_v1_checkpoint" deleted.' in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -355,12 +378,16 @@ def test_checkpoint_delete_with_single_checkpoint_assume_yes_flag(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
         result,
     )
 
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -385,6 +412,7 @@ def test_checkpoint_delete_with_single_checkpoint_cancel_success(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint delete my_v1_checkpoint",
@@ -397,7 +425,9 @@ def test_checkpoint_delete_with_single_checkpoint_cancel_success(
     assert 'The Checkpoint "my_v1_checkpoint" was not deleted.  Exiting now.' in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -416,12 +446,16 @@ def test_checkpoint_delete_with_single_checkpoint_cancel_success(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
         result,
     )
 
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -445,6 +479,7 @@ def test_checkpoint_list_with_no_checkpoints(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -457,7 +492,9 @@ def test_checkpoint_list_with_no_checkpoints(
     assert "Use the command `great_expectations checkpoint new` to create one" in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -476,6 +513,9 @@ def test_checkpoint_list_with_no_checkpoints(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(caplog, result)
 
@@ -494,6 +534,7 @@ def test_checkpoint_list_with_single_checkpoint(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -506,7 +547,9 @@ def test_checkpoint_list_with_single_checkpoint(
     assert "my_v1_checkpoint" in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -525,6 +568,9 @@ def test_checkpoint_list_with_single_checkpoint(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
@@ -546,6 +592,7 @@ def test_checkpoint_list_with_eight_checkpoints(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint list",
@@ -569,7 +616,9 @@ def test_checkpoint_list_with_eight_checkpoints(
     assert all([checkpoint_name in stdout for checkpoint_name in checkpoint_names_list])
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -588,6 +637,9 @@ def test_checkpoint_list_with_eight_checkpoints(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
@@ -613,6 +665,7 @@ def test_checkpoint_new_raises_error_on_existing_checkpoint(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint new my_minimal_simple_checkpoint",
@@ -627,7 +680,9 @@ def test_checkpoint_new_raises_error_on_existing_checkpoint(
     )
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -646,6 +701,9 @@ def test_checkpoint_new_raises_error_on_existing_checkpoint(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         caplog,
@@ -686,6 +744,7 @@ def test_checkpoint_new_happy_path_generates_a_notebook_and_checkpoint(
     mock_emit.reset_mock()
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint new passengers",
@@ -699,7 +758,8 @@ def test_checkpoint_new_happy_path_generates_a_notebook_and_checkpoint(
 
     assert mock_emit.call_count == 3
 
-    assert mock_emit.call_args_list == [
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -718,6 +778,10 @@ def test_checkpoint_new_happy_path_generates_a_notebook_and_checkpoint(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
+
     assert mock_subprocess.call_count == 1
     assert mock_webbroser.call_count == 0
 
@@ -796,6 +860,7 @@ def test_checkpoint_run_raises_error_if_checkpoint_is_not_found(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_checkpoint",
@@ -811,7 +876,9 @@ def test_checkpoint_run_raises_error_if_checkpoint_is_not_found(
     assert "Try running" in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -830,6 +897,9 @@ def test_checkpoint_run_raises_error_if_checkpoint_is_not_found(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         my_caplog=caplog,
@@ -855,6 +925,7 @@ def test_checkpoint_run_on_checkpoint_with_not_found_suite_raises_error(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_nested_checkpoint_template_1",
@@ -866,7 +937,9 @@ def test_checkpoint_run_on_checkpoint_with_not_found_suite_raises_error(
     assert "expectation_suite suite_from_template_1 not found" in stdout
 
     assert mock_emit.call_count == 3
-    assert mock_emit.call_args_list == [
+
+    # noinspection PyUnresolvedReferences
+    expected_events: List[unittest.mock._Call] = [
         mock.call(
             {"event_payload": {}, "event": "data_context.__init__", "success": True}
         ),
@@ -885,6 +958,9 @@ def test_checkpoint_run_on_checkpoint_with_not_found_suite_raises_error(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
+    actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
+    assert actual_events == expected_events
 
     assert_no_logging_messages_or_tracebacks(
         my_caplog=caplog,
@@ -960,6 +1036,7 @@ def test_checkpoint_run_on_checkpoint_with_batch_load_problem_raises_error(
 
     monkeypatch.chdir(os.path.dirname(context.root_directory))
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run bad_batch",
@@ -985,6 +1062,7 @@ def test_checkpoint_run_on_checkpoint_with_batch_load_problem_raises_error(
 
     assert mock_emit.call_count == 4
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1013,6 +1091,7 @@ def test_checkpoint_run_on_checkpoint_with_batch_load_problem_raises_error(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert actual_events == expected_events
 
@@ -1081,6 +1160,7 @@ def test_checkpoint_run_on_checkpoint_with_empty_suite_list_raises_error(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run no_suite",
@@ -1174,6 +1254,7 @@ def test_checkpoint_run_on_non_existent_validations(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run no_validations",
@@ -1276,6 +1357,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_pandas(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -1298,6 +1380,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_pandas(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1348,6 +1431,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_pandas(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -1420,6 +1504,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_sql(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -1442,6 +1527,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_sql(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1493,6 +1579,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_sql(
         ),
     ]
 
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -1568,6 +1655,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_spark(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -1590,6 +1678,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_spark(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1640,6 +1729,7 @@ def test_checkpoint_run_happy_path_with_successful_validation_spark(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -1678,6 +1768,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_pandas(
     )
     df: pd.DataFrame = pd.read_csv(filepath_or_buffer=csv_path)
     df = df.sample(frac=0.5, replace=True, random_state=1)
+    # noinspection PyTypeChecker
     df.to_csv(path_or_buf=csv_path)
 
     checkpoint_file_path: str = os.path.join(
@@ -1723,6 +1814,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_pandas(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -1735,6 +1827,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_pandas(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1785,6 +1878,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_pandas(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -1857,6 +1951,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_sql(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -1869,6 +1964,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_sql(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -1919,6 +2015,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_sql(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -1996,6 +2093,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_spark(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -2008,6 +2106,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_spark(
 
     assert mock_emit.call_count == 6
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -2058,6 +2157,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_spark(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -2141,6 +2241,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_pandas
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -2154,6 +2255,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_pandas
 
     assert mock_emit.call_count == 5
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -2197,6 +2299,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_pandas
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -2271,6 +2374,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_sql(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -2284,6 +2388,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_sql(
 
     assert mock_emit.call_count == 5
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -2327,6 +2432,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_sql(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -2412,6 +2518,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_spark(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint run my_fancy_checkpoint",
@@ -2425,6 +2532,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_spark(
 
     assert mock_emit.call_count == 5
 
+    # noinspection PyUnresolvedReferences
     expected_events: List[unittest.mock._Call] = [
         mock.call(
             {
@@ -2468,6 +2576,7 @@ def test_checkpoint_run_happy_path_with_failed_validation_due_to_bad_data_spark(
             }
         ),
     ]
+    # noinspection PyUnresolvedReferences
     actual_events: List[unittest.mock._Call] = mock_emit.call_args_list
     assert expected_events == actual_events
 
@@ -2489,6 +2598,7 @@ def test_checkpoint_script_raises_error_if_checkpoint_not_found(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script not_a_checkpoint",
@@ -2549,6 +2659,7 @@ def test_checkpoint_script_raises_error_if_python_file_exists(
 
     runner: CliRunner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script my_v1_checkpoint",
@@ -2604,6 +2715,7 @@ def test_checkpoint_script_happy_path_generates_script_pandas(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script my_v1_checkpoint",
@@ -2728,6 +2840,7 @@ def test_checkpoint_script_happy_path_executable_successful_validation_pandas(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script my_fancy_checkpoint",
@@ -2805,6 +2918,7 @@ def test_checkpoint_script_happy_path_executable_failed_validation_pandas(
     )
     df: pd.DataFrame = pd.read_csv(filepath_or_buffer=csv_path)
     df = df.sample(frac=0.5, replace=True, random_state=1)
+    # noinspection PyTypeChecker
     df.to_csv(path_or_buf=csv_path)
 
     checkpoint_file_path: str = os.path.join(
@@ -2850,6 +2964,7 @@ def test_checkpoint_script_happy_path_executable_failed_validation_pandas(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script my_fancy_checkpoint",
@@ -2971,6 +3086,7 @@ def test_checkpoint_script_happy_path_executable_failed_validation_due_to_bad_da
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api checkpoint script my_fancy_checkpoint",
diff --git a/tests/cli/test_suite.py b/tests/cli/test_suite.py
--- a/tests/cli/test_suite.py
+++ b/tests/cli/test_suite.py
@@ -3,7 +3,6 @@
 from typing import Dict, List
 from unittest import mock
 
-import click
 import pytest
 from _pytest.capture import CaptureResult
 from click.testing import CliRunner, Result
@@ -28,6 +27,7 @@
 
 def test_suite_help_output(caplog):
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(cli, ["--v3-api", "suite"], catch_exceptions=False)
     assert result.exit_code == 0
     stdout: str = result.stdout
@@ -66,6 +66,7 @@ def test_suite_demo_deprecation_message(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite demo",
@@ -127,6 +128,7 @@ def test_suite_new_non_interactive_with_suite_name_prompted_default_runs_noteboo
     expectation_suite_name: str = "warning"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite new",
@@ -226,6 +228,7 @@ def test_suite_new_non_interactive_with_suite_name_prompted_custom_runs_notebook
     expectation_suite_name: str = "test_suite_name"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite new",
@@ -325,6 +328,7 @@ def test_suite_new_non_interactive_with_suite_name_arg_custom_runs_notebook_open
     expectation_suite_name: str = "test_suite_name"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite new --expectation-suite {expectation_suite_name}",
@@ -422,6 +426,7 @@ def test_suite_new_non_interactive_with_suite_name_arg_custom_runs_notebook_no_j
     expectation_suite_name: str = "test_suite_name"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite new --expectation-suite {expectation_suite_name} --no-jupyter",
@@ -518,6 +523,7 @@ def test_suite_new_interactive_nonexistent_batch_request_json_file_raises_error(
     expectation_suite_name: str = "test_suite_name"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"""--v3-api suite new --expectation-suite {expectation_suite_name} --interactive --batch-request
@@ -593,6 +599,7 @@ def test_suite_new_interactive_malformed_batch_request_json_file_raises_error(
         json_file.write("not_proper_json")
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"""--v3-api suite new --expectation-suite {expectation_suite_name} --interactive --batch-request
@@ -675,6 +682,7 @@ def test_suite_new_interactive_valid_batch_request_from_json_file_in_notebook_ru
         json.dump(batch_request, json_file)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"""--v3-api suite new --expectation-suite {expectation_suite_name} --interactive --batch-request
@@ -794,6 +802,7 @@ def test_suite_edit_without_suite_name_raises_error(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(cli, "--v3-api suite edit", catch_exceptions=False)
     assert result.exit_code == 2
 
@@ -841,6 +850,7 @@ def test_suite_edit_datasource_and_batch_request_error(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite edit {expectation_suite_name} --datasource-name some_datasource_name --batch-request some_file.json --interactive",
@@ -902,6 +912,7 @@ def test_suite_edit_with_non_existent_suite_name_raises_error(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite edit not_a_real_suite",
@@ -978,6 +989,7 @@ def test_suite_edit_with_non_existent_datasource_shows_helpful_error_message(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite edit {expectation_suite_name} --interactive --datasource-name not_real",
@@ -1075,6 +1087,7 @@ def test_suite_edit_multiple_datasources_with_no_additional_args_without_citatio
     batch_request_string = fr"batch_request = {batch_request_string}"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -1115,6 +1128,7 @@ def test_suite_edit_multiple_datasources_with_no_additional_args_without_citatio
     # Actual testing really starts here
     runner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         [
@@ -1300,6 +1314,7 @@ def test_suite_edit_multiple_datasources_with_no_additional_args_with_citations_
     batch_request_string = fr"batch_request = {batch_request_string}"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -1336,6 +1351,7 @@ def test_suite_edit_multiple_datasources_with_no_additional_args_with_citations_
     # Actual testing really starts here
     runner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         [
@@ -1505,6 +1521,7 @@ def test_suite_edit_multiple_datasources_with_sql_with_no_additional_args_withou
     batch_request_string = fr"batch_request = {batch_request_string}"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -1545,6 +1562,7 @@ def test_suite_edit_multiple_datasources_with_sql_with_no_additional_args_withou
     # Actual testing really starts here
     runner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         [
@@ -1730,6 +1748,7 @@ def test_suite_edit_multiple_datasources_with_sql_with_no_additional_args_with_c
     batch_request_string = fr"batch_request = {batch_request_string}"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -1766,6 +1785,7 @@ def test_suite_edit_multiple_datasources_with_sql_with_no_additional_args_with_c
     # Actual testing really starts here
     runner = CliRunner(mix_stderr=False)
     monkeypatch.chdir(os.path.dirname(context.root_directory))
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         [
@@ -1925,6 +1945,7 @@ def test_suite_edit_interactive_batch_request_without_datasource_json_file_raise
         json.dump(batch_request, json_file)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"""--v3-api suite edit {expectation_suite_name} --interactive --batch-request
@@ -1988,6 +2009,7 @@ def test_suite_list_with_zero_suites(
 
     monkeypatch.chdir(os.path.dirname(context.root_directory))
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite list",
@@ -2049,6 +2071,7 @@ def test_suite_list_with_one_suite(
     )
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite list",
@@ -2115,6 +2138,7 @@ def test_suite_list_with_multiple_suites(
     assert os.path.exists(config_file_path)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite list",
@@ -2165,6 +2189,7 @@ def test_suite_delete_with_zero_suites(
     monkeypatch.chdir(os.path.dirname(context.root_directory))
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite delete not_a_suite",
@@ -2225,6 +2250,7 @@ def test_suite_delete_with_non_existent_suite(
     mock_emit.reset_mock()
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite delete not_a_suite",
@@ -2295,6 +2321,7 @@ def test_suite_delete_with_one_suite(
     assert os.path.isfile(suite_path)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite delete {expectation_suite_dir_name}.{expectation_suite_name}",
@@ -2371,6 +2398,7 @@ def test_suite_delete_canceled_with_one_suite(
     assert os.path.isfile(suite_path)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api suite delete {expectation_suite_dir_name}.{expectation_suite_name}",
@@ -2440,6 +2468,7 @@ def test_suite_delete_with_one_suite_assume_yes_flag(
     assert os.path.isfile(suite_path)
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         f"--v3-api --assume-yes suite delete {expectation_suite_dir_name}.{expectation_suite_name}",
@@ -2485,6 +2514,7 @@ def test_suite_delete_with_one_suite_assume_yes_flag(
         click_result=result,
     )
 
+    # noinspection PyTypeChecker
     result = runner.invoke(
         cli,
         f"--v3-api suite list",
@@ -2522,6 +2552,7 @@ def test_suite_new_profile_on_context_with_no_datasource_raises_error(
     expectation_suite_name: str = "test_suite_name"
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -2617,6 +2648,7 @@ def test_suite_new_profile_on_existing_suite_raises_error(
     mock_emit.reset_mock()
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -2715,6 +2747,7 @@ def test_suite_new_profile_runs_notebook_no_jupyter(
     mock_emit.reset_mock()
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
@@ -2925,6 +2958,7 @@ def test_suite_new_profile_runs_notebook_opens_jupyter(
     mock_emit.reset_mock()
 
     runner: CliRunner = CliRunner(mix_stderr=False)
+    # noinspection PyTypeChecker
     result: Result = runner.invoke(
         cli,
         [
diff --git a/tests/data_context/test_data_context_datasource_runtime_data_connector.py b/tests/data_context/test_data_context_datasource_runtime_data_connector.py
--- a/tests/data_context/test_data_context_datasource_runtime_data_connector.py
+++ b/tests/data_context/test_data_context_datasource_runtime_data_connector.py
@@ -88,6 +88,7 @@ def test_get_batch_ambiguous_parameter_pandas_engine(
 
     # raised by get_batch_list()
     with pytest.raises(ge_exceptions.GreatExpectationsTypeError):
+        # noinspection PyUnusedLocal
         batch_list: list = context.get_batch_list(
             RuntimeBatchRequest(
                 datasource_name="my_datasource",
diff --git a/tests/data_context/test_data_context_v013.py b/tests/data_context/test_data_context_v013.py
--- a/tests/data_context/test_data_context_v013.py
+++ b/tests/data_context/test_data_context_v013.py
@@ -2,7 +2,6 @@
 import os
 import re
 
-import pandas as pd
 import pytest
 from ruamel.yaml import YAML
 
@@ -11,7 +10,7 @@
 from great_expectations.core.batch import Batch, RuntimeBatchRequest
 from great_expectations.data_context import BaseDataContext
 from great_expectations.data_context.types.base import DataContextConfig
-from great_expectations.exceptions import BatchSpecError, ExecutionEngineError
+from great_expectations.exceptions import ExecutionEngineError
 from great_expectations.execution_engine.pandas_batch_data import PandasBatchData
 from great_expectations.execution_engine.sqlalchemy_batch_data import (
     SqlAlchemyBatchData,