internlm/SWE-Fixer-Train-110K huggingface dataset:
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/expectations/metrics/column_aggregate_metrics/column_histogram.py b/great_expectations/expectations/metrics/column_aggregate_metrics/column_histogram.py
--- a/great_expectations/expectations/metrics/column_aggregate_metrics/column_histogram.py
+++ b/great_expectations/expectations/metrics/column_aggregate_metrics/column_histogram.py
@@ -95,15 +95,19 @@ def _sqlalchemy(
             )
             idx += 1
 
+        negative_boundary: float
+        positive_boundary: float
         for idx in range(idx, len(bins) - 2):
+            negative_boundary = float(bins[idx])
+            positive_boundary = float(bins[idx + 1])
             case_conditions.append(
                 sa.func.sum(
                     sa.case(
                         [
                             (
                                 sa.and_(
-                                    bins[idx] <= sa.column(column),
-                                    sa.column(column) < bins[idx + 1],
+                                    negative_boundary <= sa.column(column),
+                                    sa.column(column) < positive_boundary,
                                 ),
                                 1,
                             )
@@ -124,20 +128,23 @@ def _sqlalchemy(
                 schema="api_cast", negative=False
             )
         ):
+            negative_boundary = float(bins[-2])
             case_conditions.append(
                 sa.func.sum(
-                    sa.case([(bins[-2] <= sa.column(column), 1)], else_=0)
+                    sa.case([(negative_boundary <= sa.column(column), 1)], else_=0)
                 ).label(f"bin_{str(len(bins) - 1)}")
             )
         else:
+            negative_boundary = float(bins[-2])
+            positive_boundary = float(bins[-1])
             case_conditions.append(
                 sa.func.sum(
                     sa.case(
                         [
                             (
                                 sa.and_(
-                                    bins[-2] <= sa.column(column),
-                                    sa.column(column) <= bins[-1],
+                                    negative_boundary <= sa.column(column),
+                                    sa.column(column) <= positive_boundary,
                                 ),
                                 1,
                             )


Test patch:
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/rule_based_profiler/data_assistant/data_assistant_dispatcher.py b/great_expectations/rule_based_profiler/data_assistant/data_assistant_dispatcher.py
--- a/great_expectations/rule_based_profiler/data_assistant/data_assistant_dispatcher.py
+++ b/great_expectations/rule_based_profiler/data_assistant/data_assistant_dispatcher.py
@@ -1,5 +1,5 @@
 import logging
-from typing import Dict, Optional, Set, Type
+from typing import Dict, List, Optional, Set, Type
 
 from great_expectations.rule_based_profiler.data_assistant import DataAssistant
 from great_expectations.rule_based_profiler.data_assistant.data_assistant_runner import (
@@ -109,7 +109,7 @@ def _get_data_assistant_impl(
 
         return cls._registered_data_assistants.get(name)
 
-    def __dir__(self):
+    def __dir__(self) -> List[str]:
         """
         This custom magic method is used to enable tab completion on "DataAssistantDispatcher" objects.
         """
diff --git a/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
--- a/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
+++ b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
@@ -93,6 +93,7 @@ class DataAssistantResult(SerializableDictDot):
         "metrics_by_domain",
         "expectation_configurations",
         "execution_time",
+        "citation",
         "usage_statistics_handler",
     }
 
@@ -132,6 +133,7 @@ def to_dict(self) -> dict:
                 expectation_configuration.to_json_dict()
                 for expectation_configuration in self.expectation_configurations
             ],
+            "citation": convert_to_json_serializable(data=self.citation),
             "execution_time": convert_to_json_serializable(data=self.execution_time),
             "usage_statistics_handler": self.usage_statistics_handler.__class__.__name__,
         }
@@ -142,6 +144,19 @@ def to_json_dict(self) -> dict:
         """
         return self.to_dict()
 
+    def __dir__(self) -> List[str]:
+        """
+        This custom magic method is used to enable tab completion on "DataAssistantResult" objects.
+        """
+        return list(
+            DataAssistantResult.ALLOWED_KEYS
+            | {
+                "get_expectation_suite",
+                "plot_metrics",
+                "plot_expectations_and_metrics",
+            }
+        )
+
     @property
     def _usage_statistics_handler(self) -> Optional[UsageStatisticsHandler]:
         """


Test patch:
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/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/expectations/__init__.py b/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/expectations/__init__.py
--- a/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/expectations/__init__.py
+++ b/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/expectations/__init__.py
@@ -16,5 +16,5 @@
     ExpectColumnValuesToBeProbabilisticallyGreaterThanOrEqualToThreshold,
 )
 from .expect_profile_numeric_columns_diff_between_threshold_range import (
-    ExpectProfileNumericColumnsDiffBetweenThresholdRange
+    ExpectProfileNumericColumnsDiffBetweenThresholdRange,
 )


Test patch:
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/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
@@ -960,8 +960,8 @@ def resolve_metric_bundle(
             assert len(query["ids"]) == len(
                 res[0]
             ), "unexpected number of metrics returned"
-            for idx, id in enumerate(query["ids"]):
-                resolved_metrics[id] = convert_to_json_serializable(res[0][idx])
+            for idx, count in enumerate(query["ids"]):
+                resolved_metrics[count] = convert_to_json_serializable(res[0][idx])
 
         return resolved_metrics
 
diff --git a/great_expectations/expectations/expectation.py b/great_expectations/expectations/expectation.py
--- a/great_expectations/expectations/expectation.py
+++ b/great_expectations/expectations/expectation.py
@@ -14,6 +14,7 @@
 from typing import Dict, List, Optional, Set, Tuple, Union
 
 import numpy as np
+import pandas as pd
 from dateutil.parser import parse
 
 from great_expectations import __version__ as ge_version
@@ -1738,7 +1739,7 @@ def _validate_metric_value_between(
                 except TypeError:
                     pass
 
-        if not isinstance(metric_value, datetime.datetime) and np.isnan(metric_value):
+        if not isinstance(metric_value, datetime.datetime) and pd.isnull(metric_value):
             return {"success": False, "result": {"observed_value": None}}
 
         # Checking if mean lies between thresholds
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
@@ -673,6 +673,7 @@ def _add_semantic_types_by_column_from_config_to_column_info(self, column_name):
             for semantic_type, column_list in self.semantic_types_dict.items():
                 if column_name in column_list:
                     semantic_types.append(semantic_type.upper())
+
             column_info_entry["semantic_types"] = semantic_types
             if all(
                 i in column_info_entry.get("semantic_types")


Test patch:
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/core/expectation_configuration.py b/great_expectations/core/expectation_configuration.py
--- a/great_expectations/core/expectation_configuration.py
+++ b/great_expectations/core/expectation_configuration.py
@@ -1403,7 +1403,7 @@ def metrics_validate(
             execution_engine=execution_engine,
         )
 
-    def get_domain_type(self) -> Optional[MetricDomainTypes]:
+    def get_domain_type(self) -> MetricDomainTypes:
         """Return "domain_type" of this expectation."""
         if self.expectation_type.startswith("expect_table_"):
             return MetricDomainTypes.TABLE
@@ -1417,7 +1417,9 @@ def get_domain_type(self) -> Optional[MetricDomainTypes]:
         if "column_list" in self.kwargs:
             return MetricDomainTypes.MULTICOLUMN
 
-        return None
+        raise ValueError(
+            'Unable to determine "domain_type" of this "ExpectationConfiguration" object from "kwargs" and heuristics.'
+        )
 
 
 class ExpectationConfigurationSchema(Schema):
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
@@ -1346,6 +1346,7 @@ def _build_store_from_config(
                     "manually_initialize_store_backend_id": self.variables.anonymous_usage_statistics.data_context_id
                 }
             )
+
         # Set suppress_store_backend_id = True if store is inactive and has a store_backend.
         if (
             store_name not in [store["name"] for store in self.list_active_stores()]


Test patch:
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/expectations/expectation.py b/great_expectations/expectations/expectation.py
--- a/great_expectations/expectations/expectation.py
+++ b/great_expectations/expectations/expectation.py
@@ -2086,7 +2086,11 @@ def _validate(
             success = True
         elif nonnull_count > 0:
             success = _mostly_success(
-                nonnull_count, unexpected_count, self.get_success_kwargs().get("mostly")
+                nonnull_count,
+                unexpected_count,
+                self.get_success_kwargs().get(
+                    "mostly", self.default_kwarg_values.get("mostly")
+                ),
             )
 
         return _format_map_output(
@@ -2277,7 +2281,9 @@ def _validate(
             success = _mostly_success(
                 filtered_row_count,
                 unexpected_count,
-                self.get_success_kwargs().get("mostly"),
+                self.get_success_kwargs().get(
+                    "mostly", self.default_kwarg_values.get("mostly")
+                ),
             )
 
         return _format_map_output(
@@ -2465,7 +2471,9 @@ def _validate(
             success = _mostly_success(
                 filtered_row_count,
                 unexpected_count,
-                self.get_success_kwargs().get("mostly"),
+                self.get_success_kwargs().get(
+                    "mostly", self.default_kwarg_values.get("mostly")
+                ),
             )
 
         return _format_map_output(


Test patch:
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/rule_based_profiler/data_assistant/onboarding_data_assistant.py b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
--- a/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
+++ b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
@@ -1057,7 +1057,7 @@ def _build_categorical_columns_rule() -> Rule:
                 "lower_bound": 0.0,
                 "upper_bound": None,
             },
-            "round_decimals": 4,
+            "round_decimals": 12,
         }
         parameter_builders: List[ParameterBuilder] = [
             column_distinct_values_count_metric_multi_batch_parameter_builder_for_metrics,


Test patch:
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/util.py b/great_expectations/util.py
--- a/great_expectations/util.py
+++ b/great_expectations/util.py
@@ -1320,12 +1320,27 @@ def is_nan(value: Any) -> bool:
 def isclose(
     operand_a: Union[datetime.datetime, Number],
     operand_b: Union[datetime.datetime, Number],
-    rtol=1.0e-5,
-    atol=1.0e-8,
+    rtol=1.0e-5,  # controls relative weight of "operand_b" (when its magnitude is large)
+    atol=1.0e-8,  # controls absolute accuracy (based on floating point machine precision)
     equal_nan=False,
 ) -> bool:
     """
     Checks whether or not two numbers (or timestamps) are approximately close to one another.
+
+    According to "https://numpy.org/doc/stable/reference/generated/numpy.isclose.html",
+        For finite values, isclose uses the following equation to test whether two floating point values are equivalent:
+        "absolute(a - b) <= (atol + rtol * absolute(b))".
+
+    This translates to:
+        "absolute(operand_a - operand_b) <= (atol + rtol * absolute(operand_b))", where "operand_a" is "target" quantity
+    under evaluation for being close to a "control" value, and "operand_b" serves as the "control" ("reference") value.
+
+    The values of the absolute tolerance ("atol") parameter is chosen as a sufficiently small constant for most floating
+    point machine representations (e.g., 1.0e-8), so that even if the "control" value is small in magnitude and "target"
+    and "control" are close in absolute value, then the accuracy of the assessment can still be high up to the precision
+    of the "atol" value (here, 8 digits as the default).  However, when the "control" value is large in magnitude, the
+    relative tolerance ("rtol") parameter carries a greater weight in the comparison assessment, because the acceptable
+    deviation between the two quantities can be relatively larger for them to be deemed as "close enough" in this case.
     """
     operand_a_as_number: np.float64
     operand_b_as_number: np.float64


Test patch:
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/core/configuration.py b/great_expectations/core/configuration.py
new file mode 100644
--- /dev/null
+++ b/great_expectations/core/configuration.py
@@ -0,0 +1,18 @@
+"""Contains general abstract or base classes used across configuration objects."""
+from abc import ABC
+from typing import Optional
+
+from great_expectations.types import SerializableDictDot
+
+
+class AbstractConfig(ABC, SerializableDictDot):
+    """Abstract base class for Config objects. Sets the fields that must be included on a Config."""
+
+    def __init__(self, id_: Optional[str] = None, name: Optional[str] = None) -> None:
+        # Note: name and id are optional currently to avoid updating all documentation within
+        # the scope of this work.
+        if id_ is not None:
+            self.id = id_
+        if name is not None:
+            self.name = name
+        super().__init__()


Test patch:
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/rule_based_profiler/rule_based_profiler_result.py b/great_expectations/rule_based_profiler/rule_based_profiler_result.py
--- a/great_expectations/rule_based_profiler/rule_based_profiler_result.py
+++ b/great_expectations/rule_based_profiler/rule_based_profiler_result.py
@@ -71,7 +71,6 @@ def to_dict(self) -> dict:
             ],
             "citation": self.citation,
             "execution_time": self.execution_time,
-            "_usage_statistics_handler": self._usage_statistics_handler.__class__.__name__,
         }
 
     def to_json_dict(self) -> dict:
diff --git a/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
--- a/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
+++ b/great_expectations/rule_based_profiler/types/data_assistant_result/data_assistant_result.py
@@ -138,7 +138,6 @@ class DataAssistantResult(SerializableDictDot):
         "expectation_configurations",
         "citation",
         "execution_time",
-        "_usage_statistics_handler",
     }
 
     IN_JUPYTER_NOTEBOOK_KEYS = {
@@ -198,7 +197,6 @@ def to_dict(self) -> dict:
             ],
             "citation": convert_to_json_serializable(data=self.citation),
             "execution_time": convert_to_json_serializable(data=self.execution_time),
-            "_usage_statistics_handler": self._usage_statistics_handler.__class__.__name__,
         }
 
     def to_json_dict(self) -> dict:


Test patch:
diff --git a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
--- a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
+++ b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
@@ -1647,6 +1647,7 @@ def test_volume_data_assistant_result_serialization(
         bobby_volume_data_assistant_result.to_json_dict()
         == volume_data_assistant_result_as_dict
     )
+    assert len(bobby_volume_data_assistant_result.profiler_config.rules) == 2
 
 
 @mock.patch(
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/expectations/metrics/column_map_metrics/column_values_between.py b/great_expectations/expectations/metrics/column_map_metrics/column_values_between.py
--- a/great_expectations/expectations/metrics/column_map_metrics/column_values_between.py
+++ b/great_expectations/expectations/metrics/column_map_metrics/column_values_between.py
@@ -75,7 +75,6 @@ def _pandas(
             raise ValueError("min_value cannot be greater than max_value")
 
         def is_between(val):
-            # TODO: <Alex>Make "rtol" and "atol" customizable at "ExpectationConfiguration" level.</Alex>
             # TODO Might be worth explicitly defining comparisons between types (for example, between strings and ints).
             # Ensure types can be compared since some types in Python 3 cannot be logically compared.
             # print type(val), type(min_value), type(max_value), val, min_value, max_value
@@ -200,7 +199,6 @@ def _sqlalchemy(
         if min_value is None and max_value is None:
             raise ValueError("min_value and max_value cannot both be None")
 
-        # TODO: <Alex>Make "rtol" and "atol" customizable at "ExpectationConfiguration" level.</Alex>
         if min_value is None:
             if strict_max:
                 return column < sa.literal(max_value)
@@ -314,7 +312,6 @@ def _spark(
         if min_value is None and max_value is None:
             raise ValueError("min_value and max_value cannot both be None")
 
-        # TODO: <Alex>Make "rtol" and "atol" customizable at "ExpectationConfiguration" level.</Alex>
         if min_value is None:
             if strict_max:
                 return column < F.lit(max_value)


Test patch:
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/core/usage_statistics/package_dependencies.py b/great_expectations/core/usage_statistics/package_dependencies.py
--- a/great_expectations/core/usage_statistics/package_dependencies.py
+++ b/great_expectations/core/usage_statistics/package_dependencies.py
@@ -96,8 +96,10 @@ class GEDependencies:
             "pyspark",
             "pytest",
             "pytest-benchmark",
+            "pytest-azurepipelines",
             "pytest-cov",
             "pytest-order",
+            "pytest-random-order",
             "pyupgrade",
             "requirements-parser",
             "s3fs",
@@ -142,6 +144,9 @@ class GEDependencies:
         "PyHive",
         "thrift",
         "thrift-sasl",
+        # requirements-dev-test-pipeline.txt:
+        "pytest-azurepipelines",
+        "pytest-random-order",
     ]
 
     GE_DEV_DEPENDENCIES: List[str] = set(ALL_GE_DEV_DEPENDENCIES) - set(


Test patch:
diff --git a/docker/Dockerfile.tests b/docker/Dockerfile.tests
--- a/docker/Dockerfile.tests
+++ b/docker/Dockerfile.tests
@@ -6,7 +6,7 @@ ARG SOURCE=local
 # Our base image is the official python image. If needed we can look into slimming this down.
 FROM python:${PYTHON_VERSION} AS base
 RUN apt update && apt install default-jre unixodbc unixodbc-dev locales locales-all -y && apt clean
-RUN python -m pip install --upgrade pip
+RUN python -m pip install --no-cache-dir --upgrade pip
 
 FROM base as build_local
 WORKDIR /great_expectations
@@ -19,9 +19,12 @@ RUN git clone --depth 1 --branch ${BRANCH} https://github.com/great-expectations
 WORKDIR /great_expectations
 
 FROM build_${SOURCE} AS dev
-RUN pip install --requirement requirements.txt --requirement requirements-dev.txt --constraint constraints-dev.txt
+RUN pip install --no-cache-dir --requirement requirements-dev.txt --constraint constraints-dev.txt
 RUN pip install .
 CMD [ "python", "--version"]
 
 FROM dev as test
-RUN pip install --requirement requirements-dev-test.txt --constraint constraints-dev.txt
+RUN pip install --no-cache-dir --requirement requirements-dev-test.txt --constraint constraints-dev.txt
+
+FROM test as azure
+RUN pip install --no-cache-dir --requirement requirements-dev-test-pipeline.txt --constraint constraints-dev.txt