prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Use cleaner solution for non-truncating division in python 2
  Prefer `from __future__ import division` to `1.*x/y`
  
  </issue>
  <code>
  [start of great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py]
  1 from typing import Optional
  2 
  3 from great_expectations.core import ExpectationConfiguration
  4 from great_expectations.execution_engine import (
  5     ExecutionEngine,
  6     PandasExecutionEngine,
  7     SparkDFExecutionEngine,
  8 )
  9 from great_expectations.execution_engine.sqlalchemy_execution_engine import (
  10     SqlAlchemyExecutionEngine,
  11 )
  12 from great_expectations.expectations.metrics.column_aggregate_metric import (
  13     ColumnMetricProvider,
  14     column_aggregate_partial,
  15     column_aggregate_value,
  16 )
  17 from great_expectations.expectations.metrics.column_aggregate_metric import sa as sa
  18 from great_expectations.expectations.metrics.metric_provider import metric_value
  19 from great_expectations.validator.validation_graph import MetricConfiguration
  20 
  21 
  22 def unique_proportion(_metrics):
  23     total_values = _metrics.get("table.row_count")
  24     unique_values = _metrics.get("column.distinct_values.count")
  25     null_count = _metrics.get("column_values.nonnull.unexpected_count")
  26 
  27     if total_values > 0:
  28         return unique_values / (total_values - null_count)
  29     else:
  30         return 0
  31 
  32 
  33 class ColumnUniqueProportion(ColumnMetricProvider):
  34     metric_name = "column.unique_proportion"
  35 
  36     @metric_value(engine=PandasExecutionEngine)
  37     def _pandas(*args, metrics, **kwargs):
  38         return unique_proportion(metrics)
  39 
  40     @metric_value(engine=SqlAlchemyExecutionEngine)
  41     def _sqlalchemy(*args, metrics, **kwargs):
  42         return unique_proportion(metrics)
  43 
  44     @metric_value(engine=SparkDFExecutionEngine)
  45     def _spark(*args, metrics, **kwargs):
  46         return unique_proportion(metrics)
  47 
  48     @classmethod
  49     def _get_evaluation_dependencies(
  50         cls,
  51         metric: MetricConfiguration,
  52         configuration: Optional[ExpectationConfiguration] = None,
  53         execution_engine: Optional[ExecutionEngine] = None,
  54         runtime_configuration: Optional[dict] = None,
  55     ):
  56         table_domain_kwargs = {
  57             k: v for k, v in metric.metric_domain_kwargs.items() if k != "column"
  58         }
  59         return {
  60             "column.distinct_values.count": MetricConfiguration(
  61                 "column.distinct_values.count", metric.metric_domain_kwargs
  62             ),
  63             "table.row_count": MetricConfiguration(
  64                 "table.row_count", table_domain_kwargs
  65             ),
  66             "column_values.nonnull.unexpected_count": MetricConfiguration(
  67                 "column_values.nonnull.unexpected_count", metric.metric_domain_kwargs
  68             ),
  69         }
  70
  [end of great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py b/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py
  --- a/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py
  +++ b/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py
  @@ -20,11 +20,13 @@
   
   
   def unique_proportion(_metrics):
  +    """Computes the proportion of unique non-null values out of all non-null values"""
       total_values = _metrics.get("table.row_count")
       unique_values = _metrics.get("column.distinct_values.count")
       null_count = _metrics.get("column_values.nonnull.unexpected_count")
   
  -    if total_values > 0:
  +    # Ensuring that we do not divide by 0, returning 0 if all values are nulls (we only consider non-nulls unique values)
  +    if total_values > 0 and total_values != null_count:
           return unique_values / (total_values - null_count)
       else:
           return 0
  
verification_info: {"golden_diff": "diff --git a/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py b/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py\n--- a/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py\n+++ b/great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py\n@@ -20,11 +20,13 @@\n \n \n def unique_proportion(_metrics):\n+    \"\"\"Computes the proportion of unique non-null values out of all non-null values\"\"\"\n     total_values = _metrics.get(\"table.row_count\")\n     unique_values = _metrics.get(\"column.distinct_values.count\")\n     null_count = _metrics.get(\"column_values.nonnull.unexpected_count\")\n \n-    if total_values > 0:\n+    # Ensuring that we do not divide by 0, returning 0 if all values are nulls (we only consider non-nulls unique values)\n+    if total_values > 0 and total_values != null_count:\n         return unique_values / (total_values - null_count)\n     else:\n         return 0\n", "issue": "Use cleaner solution for non-truncating division in python 2\nPrefer `from __future__ import division` to `1.*x/y`\n", "before_files": [{"content": "from typing import Optional\n\nfrom great_expectations.core import ExpectationConfiguration\nfrom great_expectations.execution_engine import (\n    ExecutionEngine,\n    PandasExecutionEngine,\n    SparkDFExecutionEngine,\n)\nfrom great_expectations.execution_engine.sqlalchemy_execution_engine import (\n    SqlAlchemyExecutionEngine,\n)\nfrom great_expectations.expectations.metrics.column_aggregate_metric import (\n    ColumnMetricProvider,\n    column_aggregate_partial,\n    column_aggregate_value,\n)\nfrom great_expectations.expectations.metrics.column_aggregate_metric import sa as sa\nfrom great_expectations.expectations.metrics.metric_provider import metric_value\nfrom great_expectations.validator.validation_graph import MetricConfiguration\n\n\ndef unique_proportion(_metrics):\n    total_values = _metrics.get(\"table.row_count\")\n    unique_values = _metrics.get(\"column.distinct_values.count\")\n    null_count = _metrics.get(\"column_values.nonnull.unexpected_count\")\n\n    if total_values > 0:\n        return unique_values / (total_values - null_count)\n    else:\n        return 0\n\n\nclass ColumnUniqueProportion(ColumnMetricProvider):\n    metric_name = \"column.unique_proportion\"\n\n    @metric_value(engine=PandasExecutionEngine)\n    def _pandas(*args, metrics, **kwargs):\n        return unique_proportion(metrics)\n\n    @metric_value(engine=SqlAlchemyExecutionEngine)\n    def _sqlalchemy(*args, metrics, **kwargs):\n        return unique_proportion(metrics)\n\n    @metric_value(engine=SparkDFExecutionEngine)\n    def _spark(*args, metrics, **kwargs):\n        return unique_proportion(metrics)\n\n    @classmethod\n    def _get_evaluation_dependencies(\n        cls,\n        metric: MetricConfiguration,\n        configuration: Optional[ExpectationConfiguration] = None,\n        execution_engine: Optional[ExecutionEngine] = None,\n        runtime_configuration: Optional[dict] = None,\n    ):\n        table_domain_kwargs = {\n            k: v for k, v in metric.metric_domain_kwargs.items() if k != \"column\"\n        }\n        return {\n            \"column.distinct_values.count\": MetricConfiguration(\n                \"column.distinct_values.count\", metric.metric_domain_kwargs\n            ),\n            \"table.row_count\": MetricConfiguration(\n                \"table.row_count\", table_domain_kwargs\n            ),\n            \"column_values.nonnull.unexpected_count\": MetricConfiguration(\n                \"column_values.nonnull.unexpected_count\", metric.metric_domain_kwargs\n            ),\n        }\n", "path": "great_expectations/expectations/metrics/column_aggregate_metrics/column_proportion_of_unique_values.py"}]}