code: def test_fit_with_categoricals(ray_start_6_cpus):
      train_df_with_cat = train_df.copy()
      test_df_with_cat = test_df.copy()
      train_df_with_cat["categorical_column"] = pd.Series(
          (["A", "B"] * math.ceil(len(train_df_with_cat) / 2))[
              : len(train_df_with_cat)
          ]
      ).astype("category")
      test_df_with_cat["categorical_column"] = pd.Series(
          (["A", "B"] * math.ceil(len(test_df_with_cat) / 2))[
              : len(test_df_with_cat)
          ]
      ).astype("category")
  
      train_dataset = ray.data.from_pandas(train_df_with_cat)
      valid_dataset = ray.data.from_pandas(test_df_with_cat)
      trainer = LightGBMTrainer(
          scaling_config=scale_config,
          label_column="target",
          params=params,
          datasets={
              TRAIN_DATASET_KEY: train_dataset,
              "valid": valid_dataset,
          },
      )
      result = trainer.fit()
      checkpoint = result.checkpoint
      model = LightGBMTrainer.get_model(checkpoint)
      assert model.pandas_categorical == [["A", "B"]]
  
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 4 for calling a global function with example usage: test_fit_with_categoricals(ray_start_6_cpus) without return types