text: from great_expectations.execution_engine import (
      PandasExecutionEngine,
      SqlAlchemyExecutionEngine,
  )
  from great_expectations.expectations.metrics import (
      ColumnMax,
      ColumnValuesNonNull,
      CompoundColumnsUnique,
      MetricProvider,
  )
  from great_expectations.expectations.metrics.map_metric_provider import (
      ColumnMapMetricProvider,
      MapMetricProvider,
  )
  from great_expectations.validator.metric_configuration import MetricConfiguration
  
  
  def test_get_table_metric_provider_metric_dependencies(empty_sqlite_db):
      mp = ColumnMax()
      metric = MetricConfiguration("column.max", {}, {})
      dependencies = mp.get_evaluation_dependencies(
          metric, execution_engine=SqlAlchemyExecutionEngine(engine=empty_sqlite_db)
      )
      assert dependencies["metric_partial_fn"].id[0] == "column.max.aggregate_fn"
  
      mp = ColumnMax()
      metric = MetricConfiguration("column.max", {}, {})
      dependencies = mp.get_evaluation_dependencies(
          metric, execution_engine=PandasExecutionEngine()
      )
  
      table_columns_metric: MetricConfiguration = dependencies["table.columns"]
      assert dependencies == {
          "table.columns": table_columns_metric,
      }
      assert dependencies["table.columns"].id == (
          "table.columns",
          (),
          (),
      )
  
  
  def test_get_aggregate_count_aware_metric_dependencies(
      spark_session, basic_spark_df_execution_engine
  ):
      mp = ColumnValuesNonNull()
      metric = MetricConfiguration("column_values.nonnull.unexpected_count", {}, {})
      dependencies = mp.get_evaluation_dependencies(
          metric, execution_engine=PandasExecutionEngine()
      )
      assert (
          dependencies["unexpected_condition"].id[0] == "column_values.nonnull.condition"
      )
  
      metric = MetricConfiguration("column_values.nonnull.unexpected_count", {}, {})
      dependencies = mp.get_evaluation_dependencies(
          metric, execution_engine=basic_spark_df_execution_engine
      )
      assert (
          dependencies["metric_partial_fn"].id[0]
          == "column_values.nonnull.unexpected_count.aggregate_fn"
      )
  
      metric = MetricConfiguration(
          "column_values.nonnull.unexpected_count.aggregate_fn", {}, {}
      )
      dependencies = mp.get_evaluation_dependencies(metric)
      assert (
          dependencies["unexpected_condition"].id[0] == "column_values.nonnull.condition"
      )
  
  
  def test_get_map_metric_dependencies():
      mp = ColumnMapMetricProvider()
      metric = MetricConfiguration("foo.unexpected_count", {}, {})
      dependencies = mp.get_evaluation_dependencies(metric)
      assert dependencies["unexpected_condition"].id[0] == "foo.condition"
  
      metric = MetricConfiguration("foo.unexpected_rows", {}, {})
      dependencies = mp.get_evaluation_dependencies(metric)
      assert dependencies["unexpected_condition"].id[0] == "foo.condition"
  
      metric = MetricConfiguration("foo.unexpected_values", {}, {})
      dependencies = mp.get_evaluation_dependencies(metric)
      assert dependencies["unexpected_condition"].id[0] == "foo.condition"
  
      metric = MetricConfiguration("foo.unexpected_value_counts", {}, {})
      dependencies = mp.get_evaluation_dependencies(metric)
      assert dependencies["unexpected_condition"].id[0] == "foo.condition"
  
      metric = MetricConfiguration("foo.unexpected_index_list", {}, {})
      dependencies = mp.get_evaluation_dependencies(metric)
      assert dependencies["unexpected_condition"].id[0] == "foo.condition"
  
  
  def test_is_sqlalchemy_metric_selectable():
      assert MapMetricProvider.is_sqlalchemy_metric_selectable(
          map_metric_provider=CompoundColumnsUnique
      )
  
      assert not MapMetricProvider.is_sqlalchemy_metric_selectable(
          map_metric_provider=ColumnValuesNonNull
      )
  