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.py b/great_expectations/data_context/data_context.py
--- a/great_expectations/data_context/data_context.py
+++ b/great_expectations/data_context/data_context.py
@@ -1693,55 +1693,35 @@ def get_validator(
             raise ValueError(
                 "Only one of batch_request or batch_request_list may be specified"
             )
-        if batch_request_list:
-            batch_list: List = []
-            for batch_request in batch_request_list:
-                batch_list.extend(
-                    self.get_batch_list(
-                        datasource_name=datasource_name,
-                        data_connector_name=data_connector_name,
-                        data_asset_name=data_asset_name,
-                        batch_request=batch_request,
-                        batch_data=batch_data,
-                        data_connector_query=data_connector_query,
-                        batch_identifiers=batch_identifiers,
-                        limit=limit,
-                        index=index,
-                        custom_filter_function=custom_filter_function,
-                        batch_spec_passthrough=batch_spec_passthrough,
-                        sampling_method=sampling_method,
-                        sampling_kwargs=sampling_kwargs,
-                        splitter_method=splitter_method,
-                        splitter_kwargs=splitter_kwargs,
-                        runtime_parameters=runtime_parameters,
-                        query=query,
-                        path=path,
-                        batch_filter_parameters=batch_filter_parameters,
-                        **kwargs,
-                    )
+
+        if not batch_request_list:
+            batch_request_list = [batch_request]
+
+        batch_list: List = []
+        for batch_request in batch_request_list:
+            batch_list.extend(
+                self.get_batch_list(
+                    datasource_name=datasource_name,
+                    data_connector_name=data_connector_name,
+                    data_asset_name=data_asset_name,
+                    batch_request=batch_request,
+                    batch_data=batch_data,
+                    data_connector_query=data_connector_query,
+                    batch_identifiers=batch_identifiers,
+                    limit=limit,
+                    index=index,
+                    custom_filter_function=custom_filter_function,
+                    batch_spec_passthrough=batch_spec_passthrough,
+                    sampling_method=sampling_method,
+                    sampling_kwargs=sampling_kwargs,
+                    splitter_method=splitter_method,
+                    splitter_kwargs=splitter_kwargs,
+                    runtime_parameters=runtime_parameters,
+                    query=query,
+                    path=path,
+                    batch_filter_parameters=batch_filter_parameters,
+                    **kwargs,
                 )
-        else:
-            batch_list: List[Batch] = self.get_batch_list(
-                datasource_name=datasource_name,
-                data_connector_name=data_connector_name,
-                data_asset_name=data_asset_name,
-                batch_request=batch_request,
-                batch_data=batch_data,
-                data_connector_query=data_connector_query,
-                batch_identifiers=batch_identifiers,
-                limit=limit,
-                index=index,
-                custom_filter_function=custom_filter_function,
-                batch_spec_passthrough=batch_spec_passthrough,
-                sampling_method=sampling_method,
-                sampling_kwargs=sampling_kwargs,
-                splitter_method=splitter_method,
-                splitter_kwargs=splitter_kwargs,
-                runtime_parameters=runtime_parameters,
-                query=query,
-                path=path,
-                batch_filter_parameters=batch_filter_parameters,
-                **kwargs,
             )
 
         # We get a single batch_definition so we can get the execution_engine here. All batches will share the same one
diff --git a/great_expectations/datasource/data_connector/data_connector.py b/great_expectations/datasource/data_connector/data_connector.py
--- a/great_expectations/datasource/data_connector/data_connector.py
+++ b/great_expectations/datasource/data_connector/data_connector.py
@@ -1,13 +1,12 @@
 import logging
-import random
 from copy import deepcopy
 from typing import Any, List, Optional, Tuple
 
 from great_expectations.core.batch import BatchDefinition, BatchMarkers, BatchRequest
 from great_expectations.core.id_dict import BatchSpec
 from great_expectations.execution_engine import ExecutionEngine
-from great_expectations.validator import validator
 from great_expectations.validator.validation_graph import MetricConfiguration
+from great_expectations.validator.validator import Validator
 
 logger = logging.getLogger(__name__)
 
diff --git a/great_expectations/validator/validator.py b/great_expectations/validator/validator.py
--- a/great_expectations/validator/validator.py
+++ b/great_expectations/validator/validator.py
@@ -14,7 +14,7 @@
 from tqdm.auto import tqdm
 
 from great_expectations import __version__ as ge_version
-from great_expectations.core.batch import Batch, BatchDefinition
+from great_expectations.core.batch import Batch
 from great_expectations.core.expectation_configuration import ExpectationConfiguration
 from great_expectations.core.expectation_suite import (
     ExpectationSuite,
@@ -29,7 +29,6 @@
 from great_expectations.data_asset.util import recursively_convert_to_json_serializable
 from great_expectations.dataset import PandasDataset, SparkDFDataset, SqlAlchemyDataset
 from great_expectations.dataset.sqlalchemy_dataset import SqlAlchemyBatchReference
-from great_expectations.datasource import DataConnector, Datasource
 from great_expectations.exceptions import (
     GreatExpectationsError,
     InvalidExpectationConfigurationError,


Test patch: