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/metric_provider.py b/great_expectations/expectations/metrics/metric_provider.py
--- a/great_expectations/expectations/metrics/metric_provider.py
+++ b/great_expectations/expectations/metrics/metric_provider.py
@@ -22,12 +22,27 @@
 logger = logging.getLogger(__name__)
 
 
+@public_api
 def metric_value(
     engine: Type[ExecutionEngine],
     metric_fn_type: Union[str, MetricFunctionTypes] = MetricFunctionTypes.VALUE,
     **kwargs,
 ):
-    """The metric decorator annotates a method"""
+    """Decorator used to register a specific function as a metric value function.
+
+    Metric value functions are used by MetricProviders to immediately return
+    the value of the requested metric.
+
+    ---Documentation---
+        - https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/overview
+
+    Args:
+        engine: the *type* of ExecutionEngine that this partial supports
+        metric_fn_type: the type of metric function. Usually the default value should be maintained.
+
+    Returns:
+        Decorated function
+    """
 
     def wrapper(metric_fn: Callable):
         @wraps(metric_fn)
@@ -42,13 +57,32 @@ def inner_func(*args, **kwargs):
     return wrapper
 
 
+@public_api
 def metric_partial(
     engine: Type[ExecutionEngine],
     partial_fn_type: Union[str, MetricPartialFunctionTypes],
     domain_type: Union[str, MetricDomainTypes],
     **kwargs,
 ):
-    """The metric decorator annotates a method"""
+    """Decorator used to register a specific function as a metric partial.
+
+    Metric partial functions are used by MetricProviders to support batching of
+    requests for multiple metrics in an ExecutionEngine. Instead of returning
+    the metric value immediately, they return a different function that the
+    ExecutionEngine can execute locally on your data to obtain the metric value.
+
+    ---Documentation---
+        - https://docs.greatexpectations.io/docs/guides/expectations/features_custom_expectations/how_to_add_spark_support_for_an_expectation
+        - https://docs.greatexpectations.io/docs/guides/expectations/features_custom_expectations/how_to_add_sqlalchemy_support_for_an_expectation
+
+    Args:
+        engine: the *type* of ExecutionEngine that this partial supports
+        partial_fn_type: the type of partial function
+        domain_type: the type of domain this metric function processes
+
+    Returns:
+        Decorated function
+    """
 
     def wrapper(metric_fn: Callable):
         @wraps(metric_fn)


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_validation_result.py b/great_expectations/core/expectation_validation_result.py
--- a/great_expectations/core/expectation_validation_result.py
+++ b/great_expectations/core/expectation_validation_result.py
@@ -433,7 +433,6 @@ class ExpectationSuiteValidationResultMeta(TypedDict):
     validation_time: str
 
 
-@public_api
 class ExpectationSuiteValidationResult(SerializableDictDot):
     """The result of a batch of data validated against an Expectation Suite.
 
diff --git a/great_expectations/expectations/metrics/metric_provider.py b/great_expectations/expectations/metrics/metric_provider.py
--- a/great_expectations/expectations/metrics/metric_provider.py
+++ b/great_expectations/expectations/metrics/metric_provider.py
@@ -4,7 +4,6 @@
 
 import great_expectations.exceptions as gx_exceptions
 from great_expectations.core import ExpectationConfiguration
-from great_expectations.core._docs_decorators import public_api
 from great_expectations.core.metric_domain_types import MetricDomainTypes
 from great_expectations.core.metric_function_types import (
     MetricFunctionTypes,
@@ -22,7 +21,6 @@
 logger = logging.getLogger(__name__)
 
 
-@public_api
 def metric_value(
     engine: Type[ExecutionEngine],
     metric_fn_type: Union[str, MetricFunctionTypes] = MetricFunctionTypes.VALUE,
@@ -57,7 +55,6 @@ def inner_func(*args, **kwargs):
     return wrapper
 
 
-@public_api
 def metric_partial(
     engine: Type[ExecutionEngine],
     partial_fn_type: Union[str, MetricPartialFunctionTypes],
@@ -100,7 +97,6 @@ def inner_func(*args, **kwargs):
     return wrapper
 
 
-@public_api
 class MetricProvider(metaclass=MetaMetricProvider):
     """Base class for all metric providers.
 


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.py b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
--- a/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
+++ b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py
@@ -444,7 +444,7 @@ def build_regex_pattern_string_parameter_builder(
                 metric_domain_kwargs=DOMAIN_KWARGS_PARAMETER_FULLY_QUALIFIED_NAME,
                 metric_value_kwargs=None,
                 threshold=1.0,
-                candidate_regexes=None,
+                candidate_regexes=f"{VARIABLES_KEY}candidate_regexes",
                 evaluation_parameter_builder_configs=None,
                 data_context=None,
             )
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
@@ -905,6 +905,7 @@ def _build_text_columns_rule() -> Rule:
                 "upper_bound": None,
             },
             "round_decimals": 0,
+            "candidate_regexes": None,
             "success_ratio": 7.5e-1,
         }
         parameter_builders: List[ParameterBuilder] = [


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/datasource/data_connector/util.py b/great_expectations/datasource/data_connector/util.py
--- a/great_expectations/datasource/data_connector/util.py
+++ b/great_expectations/datasource/data_connector/util.py
@@ -346,19 +346,17 @@ def sanitize_prefix_for_s3(text: str) -> str:
 
 
 def normalize_directory_path(
-    dir_path: Union[pathlib.Path, str],
+    dir_path: Union[PathStr],
     root_directory_path: Optional[PathStr] = None,
 ) -> pathlib.Path:
-    if isinstance(dir_path, str):
-        dir_path = pathlib.Path(dir_path)
-
-    if isinstance(root_directory_path, str):
-        root_directory_path = pathlib.Path(root_directory_path)
+    dir_path = pathlib.Path(dir_path)
 
     # If directory is a relative path, interpret it as relative to the root directory.
     if dir_path.is_absolute() or root_directory_path is None:
         return dir_path
 
+    root_directory_path = pathlib.Path(root_directory_path)
+
     return root_directory_path.joinpath(dir_path)
 
 
diff --git a/great_expectations/util.py b/great_expectations/util.py
--- a/great_expectations/util.py
+++ b/great_expectations/util.py
@@ -405,16 +405,12 @@ def is_library_loadable(library_name: str) -> bool:
 def load_class(class_name: str, module_name: str):
     if class_name is None:
         raise TypeError("class_name must not be None")
-
     if not isinstance(class_name, str):
         raise TypeError("class_name must be a string")
-
     if module_name is None:
         raise TypeError("module_name must not be None")
-
     if not isinstance(module_name, str):
         raise TypeError("module_name must be a string")
-
     try:
         verify_dynamic_loading_support(module_name=module_name)
     except FileNotFoundError:


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/experimental/great_expectations_experimental/expectations/expect_multicolumn_values_not_to_be_all_null.py b/contrib/experimental/great_expectations_experimental/expectations/expect_multicolumn_values_not_to_be_all_null.py
--- a/contrib/experimental/great_expectations_experimental/expectations/expect_multicolumn_values_not_to_be_all_null.py
+++ b/contrib/experimental/great_expectations_experimental/expectations/expect_multicolumn_values_not_to_be_all_null.py
@@ -34,8 +34,7 @@ class MulticolumnValuesNotAllNull(MulticolumnMapMetricProvider):
 
     @multicolumn_condition_partial(engine=PandasExecutionEngine)
     def _pandas(cls, column_list, **kwargs):
-        row_wise_cond = column_list.isna().sum(axis=1) < len(column_list)
-        return row_wise_cond
+        return column_list.notna().any(axis=1)
 
     # This method defines the business logic for evaluating your metric when using a SqlAlchemyExecutionEngine
     # @multicolumn_condition_partial(engine=SqlAlchemyExecutionEngine)
@@ -118,7 +117,7 @@ class ExpectMulticolumnValuesNotToBeAllNull(MulticolumnMapExpectation):
     )
 
     # This dictionary contains default values for any parameters that should have default values
-    default_kwarg_values = {}
+    default_kwarg_values = {"ignore_row_if": "never"}
 
     def validate_configuration(
         self, configuration: Optional[ExpectationConfiguration] = None


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/batch.py b/great_expectations/core/batch.py
--- a/great_expectations/core/batch.py
+++ b/great_expectations/core/batch.py
@@ -16,6 +16,7 @@
 from great_expectations.util import deep_filter_properties_iterable, load_class
 
 if TYPE_CHECKING:
+    from great_expectations.experimental.datasources.interfaces import Batch as XBatch
     from great_expectations.experimental.datasources.interfaces import (
         BatchRequest as XBatchRequest,
     )
@@ -44,13 +45,20 @@
     )
 
 
-def _get_x_batch_request_class() -> Type[XBatchRequest]:
+def _get_x_batch_request_class() -> Type[XBatch]:
     """Using this function helps work around circular import dependncies."""
     module_name = "great_expectations.experimental.datasources.interfaces"
     class_name = "BatchRequest"
     return load_class(class_name=class_name, module_name=module_name)
 
 
+def _get_x_batch_class() -> Type[XBatch]:
+    """Using this function helps work around circular import dependncies."""
+    module_name = "great_expectations.experimental.datasources.interfaces"
+    class_name = "Batch"
+    return load_class(class_name=class_name, module_name=module_name)
+
+
 def _get_metrics_calculator_class() -> Type[MetricsCalculator]:
     """Using this function helps work around circular import dependncies."""
     module_name = "great_expectations.validator.metrics_calculator"
diff --git a/great_expectations/core/batch_manager.py b/great_expectations/core/batch_manager.py
--- a/great_expectations/core/batch_manager.py
+++ b/great_expectations/core/batch_manager.py
@@ -9,7 +9,7 @@
     BatchDataType,
     BatchDefinition,
     BatchMarkers,
-    _get_x_batch_request_class,
+    _get_x_batch_class,
 )
 
 if TYPE_CHECKING:
@@ -147,7 +147,7 @@ def load_batch_list(self, batch_list: List[Batch]) -> None:
         for batch in batch_list:
             try:
                 assert isinstance(
-                    batch, (Batch, _get_x_batch_request_class())
+                    batch, (Batch, _get_x_batch_class())
                 ), "Batch objects provided to BatchManager must be formal Great Expectations Batch typed objects."
             except AssertionError as e:
                 logger.error(str(e))


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/datasource/fluent/spark_azure_blob_storage_datasource.py b/great_expectations/datasource/fluent/spark_azure_blob_storage_datasource.py
--- a/great_expectations/datasource/fluent/spark_azure_blob_storage_datasource.py
+++ b/great_expectations/datasource/fluent/spark_azure_blob_storage_datasource.py
@@ -161,7 +161,7 @@ def add_csv_asset(
             container=container,
             name_starts_with=name_starts_with,
             delimiter=delimiter,
-            file_path_template_map_fn=AzureUrl.AZURE_BLOB_STORAGE_HTTPS_URL_TEMPLATE.format,
+            file_path_template_map_fn=AzureUrl.AZURE_BLOB_STORAGE_WASBS_URL_TEMPLATE.format,
         )
         asset._test_connection_error_message = (
             AzureBlobStorageDataConnector.build_test_connection_error_message(


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/rule_based_profiler/domain_builder/data_profiler_column_domain_builder.py b/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/rule_based_profiler/domain_builder/data_profiler_column_domain_builder.py
--- a/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/rule_based_profiler/domain_builder/data_profiler_column_domain_builder.py
+++ b/contrib/capitalone_dataprofiler_expectations/capitalone_dataprofiler_expectations/rule_based_profiler/domain_builder/data_profiler_column_domain_builder.py
@@ -96,7 +96,7 @@ def _get_domains(
         Returns:
             List of domains that match the desired tolerance limits.
         """
-        batch_ids: List[str] = self.get_batch_ids(variables=variables)  # type: ignore[assignment] # could None
+        batch_ids: List[str] = self.get_batch_ids(variables=variables)  # type: ignore[assignment] # could be None
 
         validator: Validator = self.get_validator(variables=variables)  # type: ignore[assignment] # could be None
 
diff --git a/great_expectations/rule_based_profiler/domain_builder/multi_column_domain_builder.py b/great_expectations/rule_based_profiler/domain_builder/multi_column_domain_builder.py
--- a/great_expectations/rule_based_profiler/domain_builder/multi_column_domain_builder.py
+++ b/great_expectations/rule_based_profiler/domain_builder/multi_column_domain_builder.py
@@ -80,7 +80,7 @@ def _get_domains(
         Returns:
             List of domains that match the desired tolerance limits.
         """
-        batch_ids: List[str] = self.get_batch_ids(variables=variables)  # type: ignore[assignment] # could None
+        batch_ids: List[str] = self.get_batch_ids(variables=variables)  # type: ignore[assignment] # could be None
 
         validator: Validator = self.get_validator(variables=variables)  # type: ignore[assignment] # could be None
 


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/metrics/metric_provider.py b/great_expectations/expectations/metrics/metric_provider.py
--- a/great_expectations/expectations/metrics/metric_provider.py
+++ b/great_expectations/expectations/metrics/metric_provider.py
@@ -189,7 +189,7 @@ def _register_metric_functions(cls) -> None:
                 To instruct "ExecutionEngine" accordingly, original metric is registered with its "declared" name, but
                 with "metric_provider" function omitted (set to "None"), and additional "AGGREGATE_FN" metric, with its
                 "metric_provider" set to (decorated) implementation function, defined in metric class, is registered.
-                Then "AGGREGATE_FN" metric can specified with key "metric_partial_fn" as evaluation metric dependency.
+                Then "AGGREGATE_FN" metric is specified with key "metric_partial_fn" as evaluation metric dependency.
                 By convention, aggregate partial metric implementation functions return three-valued tuple, containing
                 deferred execution metric implementation function of corresponding "ExecutionEngine" backend (called
                 "metric_aggregate") as well as "compute_domain_kwargs" and "accessor_domain_kwargs", which are relevant


Test patch:
diff --git a/tests/profile/test_basic_suite_builder_profiler.py b/tests/profile/test_basic_suite_builder_profiler.py
--- a/tests/profile/test_basic_suite_builder_profiler.py
+++ b/tests/profile/test_basic_suite_builder_profiler.py
@@ -78,6 +78,9 @@ def datetime_dataset(test_backend):
     is_library_loadable(library_name="trino"),
     reason="datetime doesnt exist in Trino",
 )
+@pytest.mark.xfail(
+    reason='Utility methods "get_dataset()" is part of deprecated GX-V2 functionality (it must no longer be used).'
+)
 def test__find_next_datetime_column(datetime_dataset, numeric_high_card_dataset):
     columns = datetime_dataset.get_table_columns()
     column_cache = {}
@@ -113,6 +116,9 @@ def test__find_next_datetime_column(datetime_dataset, numeric_high_card_dataset)
     is_library_loadable(library_name="trino"),
     reason="datetime doesnt exist in Trino",
 )
+@pytest.mark.xfail(
+    reason='Utility methods "get_dataset()" is part of deprecated GX-V2 functionality (it must no longer be used).'
+)
 def test__create_expectations_for_datetime_column(datetime_dataset):
     column = "datetime"
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/core/expect_column_values_to_be_of_type.py b/great_expectations/expectations/core/expect_column_values_to_be_of_type.py
--- a/great_expectations/expectations/core/expect_column_values_to_be_of_type.py
+++ b/great_expectations/expectations/core/expect_column_values_to_be_of_type.py
@@ -142,7 +142,9 @@ class ExpectColumnValuesToBeOfType(ColumnMapExpectation):
             PandasDataset include any numpy dtype values (such as 'int64') or native python types (such as 'int'), \
             whereas valid types for a SqlAlchemyDataset include types named by the current driver such as 'INTEGER' \
             in most SQL dialects and 'TEXT' in dialects such as postgresql. Valid types for SparkDFDataset include \
-            'StringType', 'BooleanType' and other pyspark-defined type names.
+            'StringType', 'BooleanType' and other pyspark-defined type names. Note that the strings representing these \
+            types are sometimes case-sensitive. For instance, with a Pandas backend `timestamp` will be unrecognized and
+            fail the expectation, while `Timestamp` would pass with valid data.
 
     Keyword Args:
         mostly (None or a float between 0 and 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/dataset/sparkdf_dataset.py b/great_expectations/dataset/sparkdf_dataset.py
--- a/great_expectations/dataset/sparkdf_dataset.py
+++ b/great_expectations/dataset/sparkdf_dataset.py
@@ -1218,7 +1218,7 @@ def expect_column_values_to_be_in_type_list(
             types = []
             for type_ in type_list:
                 try:
-                    type_class = getattr(types, type_)
+                    type_class = getattr(pyspark.types, type_)
                     types.append(type_class)
                 except AttributeError:
                     logger.debug(f"Unrecognized type: {type_}")


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/self_check/util.py b/great_expectations/self_check/util.py
--- a/great_expectations/self_check/util.py
+++ b/great_expectations/self_check/util.py
@@ -435,7 +435,7 @@
 except ImportError:
     pyathena = None  # type: ignore[assignment]
     athenatypes = None
-    athenaDialect = None  # type: ignore[assignment,misc]
+    athenaDialect = None
     ATHENA_TYPES = {}
 
 # # Others from great_expectations/dataset/sqlalchemy_dataset.py


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/sparkdf_execution_engine.py b/great_expectations/execution_engine/sparkdf_execution_engine.py
--- a/great_expectations/execution_engine/sparkdf_execution_engine.py
+++ b/great_expectations/execution_engine/sparkdf_execution_engine.py
@@ -242,6 +242,9 @@ def load_batch_data(  # type: ignore[override]
                 "SparkDFExecutionEngine requires batch data that is either a DataFrame or a SparkDFBatchData object"
             )
 
+        if self._persist:
+            batch_data.dataframe.persist()
+
         super().load_batch_data(batch_id=batch_id, batch_data=batch_data)
 
     def get_batch_data_and_markers(


Test patch: