code: def test_validation(ray_start_6_cpus):
      train_dataset = ray.data.from_pandas(train_df)
      valid_dataset = ray.data.from_pandas(test_df)
      with pytest.raises(KeyError, match=TRAIN_DATASET_KEY):
          LightGBMTrainer(
              scaling_config=ScalingConfig(num_workers=2),
              label_column="target",
              params=params,
              datasets={"valid": valid_dataset},
          )
      with pytest.raises(KeyError, match="dmatrix_params"):
          LightGBMTrainer(
              scaling_config=ScalingConfig(num_workers=2),
              label_column="target",
              params=params,
              dmatrix_params={"data": {}},
              datasets={
                  TRAIN_DATASET_KEY: train_dataset,
                  "valid": valid_dataset,
              },
          )
  
imports: import math
  import lightgbm
  import pandas
  import pytest
  from sklearn.datasets import load_breast_cancer
  from sklearn.model_selection import train_test_split
  import ray
  from ray import tune
  from ray.train import ScalingConfig
  from ray.train.constants import TRAIN_DATASET_KEY
  from ray.train.lightgbm import LightGBMTrainer
label_desc: Use image node_id 8 for calling a global function with example usage: test_validation(ray_start_6_cpus) without return types