code: def _run(self, output_directory: str) -> BaseCard:
      dataset_dst_path = os.path.abspath(
          os.path.join(output_directory, self.dataset_output_name)
      )
      self.dataset.resolve_to_parquet(
          dst_path=dataset_dst_path,
      )
      _logger.debug(
          "Successfully stored data in parquet format at '%s'",
          dataset_dst_path,
      )
  
      ingested_df = read_parquet_as_pandas_df(
          data_parquet_path=dataset_dst_path
      )
      if self.step_class() == StepClass.TRAINING:
          if self.target_col not in ingested_df.columns:
              raise MlflowException(
                  f"Target column '{self.target_col}' not found in ingested dataset.",
                  error_code=INVALID_PARAMETER_VALUE,
              )
          if self.task == "classification":
              validate_classification_config(
                  self.task,
                  self.positive_class,
                  ingested_df,
                  self.target_col,
              )
              cardinality = ingested_df[self.target_col].nunique()
              if cardinality > 2 and self.positive_class is not None:
                  raise MlflowException(
                      f"Target column '{self.target_col}' must have a cardinality of 2,"
                      f"found '{cardinality}'.",
                      error_code=INVALID_PARAMETER_VALUE,
                  )
              if self.positive_class is not None and cardinality != 2:
                  raise MlflowException(
                      f"`For binary classification problems, "
                      f"target column '{self.target_col}' must have a cardinality of 2,"
                      f"found '{cardinality}'. `positive_class` was set, "
                      f"so we treat this problem as a binary classification problem. ",
                      error_code=INVALID_PARAMETER_VALUE,
                  )
  
      ingested_dataset_profile = None
      if not self.skip_data_profiling:
          _logger.debug("Profiling ingested dataset")
          ingested_dataset_profile = get_pandas_data_profiles(
              [["Profile of Ingested Dataset", ingested_df]]
          )
          dataset_profile_path = Path(
              str(
                  os.path.join(
                      output_directory,
                      BaseIngestStep._DATASET_PROFILE_OUTPUT_NAME,
                  )
              )
          )
          dataset_profile_path.write_text(
              ingested_dataset_profile, encoding="utf-8"
          )
          _logger.debug(
              f"Wrote dataset profile to '{dataset_profile_path}'"
          )
  
      schema = pd.io.json.build_table_schema(ingested_df, index=False)
  
      return self._build_step_card(
          ingested_dataset_profile=ingested_dataset_profile,
          ingested_rows=len(ingested_df),
          schema=schema,
          data_preview=ingested_df.head(),
          dataset_src_location=getattr(self.dataset, "location", None),
          dataset_sql=getattr(self.dataset, "sql", None),
      )
  
imports: import abc
  import logging
  import os
  from pathlib import Path
  from typing import Any, Dict, Optional
  import pandas
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.recipes.artifacts import DataframeArtifact
  from mlflow.recipes.cards import BaseCard
  from mlflow.recipes.step import BaseStep, StepClass
  from mlflow.recipes.steps.ingest.datasets import CustomDataset, DeltaTableDataset, ParquetDataset, SparkSqlDataset
  from mlflow.recipes.utils.step import get_pandas_data_profiles, validate_classification_config
  from mlflow.utils.file_utils import read_parquet_as_pandas_df
label_desc: Use image node_id 2 for calling the BaseIngestStep obj's underlying member method code with example usage: obj._run(output_directory) and returns: self