code: def test_ranking_preprocessing_split_strategies(
      tenrec_data_path, split_strategy
  ):
      with tempfile.TemporaryDirectory() as tmp_output_folder:
          additional_kwargs = {}
          if split_strategy in ["random", "random_by_user"]:
              additional_kwargs["random_split_eval_perc"] = 0.2
          elif split_strategy == "temporal":
              additional_kwargs["timestamp_feature"] = "item_id"
              additional_kwargs[
                  "dataset_split_temporal_timestamp"
              ] = 15000
  
          args = kwargs_to_cli_ags(
              data_path=os.path.join(
                  tenrec_data_path, "raw/QK-video-10M.csv"
              ),
              input_data_format="csv",
              csv_na_values="\\N",
              output_path=tmp_output_folder,
              categorical_features="user_id,item_id,video_category,gender,age",
              binary_classif_targets="click,follow,like,share",
              regression_targets="watching_times",
              to_int32="user_id,item_id",
              to_int16="watching_times",
              to_int8="gender,age,video_category,click,follow,like,share",
              user_id_feature="user_id",
              item_id_feature="item_id",
              dataset_split_strategy=split_strategy,
              **additional_kwargs,
          )
          runner = PreprocessingRunner(args)
          runner.run()
  
          total_rows = 10000000
  
          train_df = cudf.read_parquet(
              os.path.join(tmp_output_folder, "train/*.parquet")
          )
          rows_train = len(train_df)
  
          eval_df = cudf.read_parquet(
              os.path.join(tmp_output_folder, "eval/*.parquet")
          )
          rows_eval = len(eval_df)
  
          assert rows_train + rows_eval == total_rows
  
          if split_strategy in ["random", "random_by_user"]:
              assert 0.20 == pytest.approx(
                  rows_eval / float(total_rows), abs=0.02
              )
  
              if split_strategy == "random_by_user":
                  assert train_df["user_id"].nunique() == pytest.approx(
                      eval_df["user_id"].nunique(), rel=0.05
                  )
  
          elif split_strategy == "temporal":
              assert rows_train == 4636381
              assert rows_eval == 5363619
  
file_path: Merlin/tests/integration/examples/quick_start/test_preproc.py
imports: import os
  import tempfile
  import cudf
  import numpy
  import pytest
  from examples.quick_start.scripts.preproc.preprocessing import PreprocessingRunner
  from merlin.schema import Tags
  from merlin.schema.io.tensorflow_metadata import TensorflowMetadata
label_desc: Use image node_id 6 for calling a global function with example usage: test_ranking_preprocessing_split_strategies(tenrec_data_path, split_strategy) without return types