code: def test_sanity_check_raises_error():
      mock_config = MagicMock()
      mock_config.dataset.parent_id_column = "parent_id"
      mock_config.dataset.answer_column = "answer"
  
      df_1 = pd.DataFrame(
          {
              "id": [1, 2, 3, 4],
              "parent_id": [2, None, 4, 1],
              "answer": ["a", "b", "c", "d"],
              "other_data": ["a", "b", "c", "d"],
          }
      )
      CustomDataset.sanity_check(df_1, mock_config)
  
      df_2 = pd.DataFrame(
          {
              "id": [1, 2, 3, 4],
              "parent_id": [None, None, None, None],
              "answer": ["a", "b", "c", "d"],
              "other_data": ["a", "b", "c", "d"],
          }
      )
      CustomDataset.sanity_check(df_2, mock_config)
  
      invalid_df_1 = pd.DataFrame(
          {
              "id": [1, 2, 3, 4],
              "parent_id": [1, 2, 3, 4],
              "answer": ["a", "b", "c", "d"],
              "other_data": ["a", "b", "c", "d"],
          }
      )
      with pytest.raises(
          AssertionError,
          match="Parent id column is the same as id column for some rows",
      ):
          CustomDataset.sanity_check(invalid_df_1, mock_config)
  
      invalid_df_2 = pd.DataFrame(
          {
              "id": [1, 2, 3, 4],
              "parent_id": [2, 3, 4, 1],
              "other_data": ["a", "b", "c", "d"],
          }
      )
      with pytest.raises(
          AssertionError,
          match="Did not find any conversation start. "
          "Please ensure that some parent ids are empty.",
      ):
          CustomDataset.sanity_check(invalid_df_2, mock_config)
  
file_path: h2o-llmstudio/tests/src/datasets/test_text_causal_language_modeling_ds.py
imports: from unittest import mock
  from unittest.mock import MagicMock, patch
  import numpy
  import pandas
  import pytest
  from llm_studio.app_utils.default_datasets import prepare_default_dataset_causal_language_modeling
  from llm_studio.python_configs.text_causal_language_modeling_config import ConfigNLPCausalLMDataset, ConfigNLPCausalLMTokenizer, ConfigProblemBase
  from llm_studio.src.datasets.text_causal_language_modeling_ds import CustomDataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_sanity_check_raises_error() without return types