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/datasource/data_connector/inferred_asset_s3_data_connector.py b/great_expectations/datasource/data_connector/inferred_asset_s3_data_connector.py
--- a/great_expectations/datasource/data_connector/inferred_asset_s3_data_connector.py
+++ b/great_expectations/datasource/data_connector/inferred_asset_s3_data_connector.py
@@ -28,7 +28,7 @@ class InferredAssetS3DataConnector(InferredAssetFilePathDataConnector):
 
     The InferredAssetS3DataConnector is one of two classes (ConfiguredAssetS3DataConnector being the
     other one) designed for connecting to filesystem-like data, more specifically files on S3. It connects to assets
-    inferred from directory and file name by default_regex and glob_directive.
+    inferred from bucket, prefix, and file name by default_regex.
 
     InferredAssetS3DataConnector that operates on S3 buckets and determines
     the data_asset_name implicitly (e.g., through the combination of the regular expressions pattern and group names)
diff --git a/great_expectations/profile/user_configurable_profiler.py b/great_expectations/profile/user_configurable_profiler.py
--- a/great_expectations/profile/user_configurable_profiler.py
+++ b/great_expectations/profile/user_configurable_profiler.py
@@ -1,4 +1,3 @@
-import datetime
 import logging
 import math
 
@@ -202,6 +201,7 @@ def build_suite(self):
 
         """
         if len(self.profile_dataset.get_expectation_suite().expectations) > 0:
+            # noinspection PyProtectedMember
             suite_name = self.profile_dataset._expectation_suite.expectation_suite_name
             self.profile_dataset._expectation_suite = ExpectationSuite(suite_name)
 
@@ -1084,6 +1084,7 @@ def _build_expectations_for_all_column_types(
                     column, min_value=pct_unique, max_value=pct_unique
                 )
             else:
+                # noinspection PyProtectedMember
                 profile_dataset._expectation_suite.remove_expectation(
                     ExpectationConfiguration(
                         expectation_type="expect_column_proportion_of_unique_values_to_be_between",


Test patch:
diff --git a/tests/profile/test_user_configurable_profiler_v3_batch_request.py b/tests/profile/test_user_configurable_profiler_v3_batch_request.py
--- a/tests/profile/test_user_configurable_profiler_v3_batch_request.py
+++ b/tests/profile/test_user_configurable_profiler_v3_batch_request.py
@@ -7,7 +7,7 @@
 import pytest
 
 import great_expectations as ge
-from great_expectations.core.batch import Batch, BatchRequest, RuntimeBatchRequest
+from great_expectations.core.batch import Batch, RuntimeBatchRequest
 from great_expectations.core.util import get_or_create_spark_application
 from great_expectations.data_context.util import file_relative_path
 from great_expectations.execution_engine import SqlAlchemyExecutionEngine
@@ -29,8 +29,6 @@
 from great_expectations.validator.validator import Validator
 from tests.profile.conftest import get_set_of_columns_and_expectations_from_suite
 
-logger = logging.getLogger(__name__)
-
 try:
     import sqlalchemy as sqlalchemy
     import sqlalchemy.dialects.postgresql as postgresqltypes
@@ -52,8 +50,6 @@
     postgresqltypes = None
     POSTGRESQL_TYPES = {}
 
-logger = logging.getLogger(__name__)
-
 
 def get_pandas_runtime_validator(context, df):
     batch_request = RuntimeBatchRequest(
@@ -957,11 +953,13 @@ def test_error_handling_for_expect_compound_columns_to_be_unique(
     with caplog.at_level(logging.WARNING):
         suite = profiler.build_suite()
 
-    log_warnings = caplog.messages
-    assert len(log_warnings) == 1
+    log_warning_records = list(
+        filter(lambda record: record.levelname == "WARNING", caplog.records)
+    )
+    assert len(log_warning_records) == 1
 
     assert (
-        log_warnings[0]
+        log_warning_records[0].message
         == "expect_compound_columns_to_be_unique is not currently available in the V3 (Batch Request) API. Specifying a compound key will not add any expectations. This will be updated when that expectation becomes available."
     )