code: def test_timestamp_splitter(spark_dataset):
      dfs_rating = spark_dataset.withColumn(
          DEFAULT_TIMESTAMP_COL,
          col(DEFAULT_TIMESTAMP_COL).cast("float"),
      )
  
      splits = spark_timestamp_split(
          dfs_rating,
          ratio=RATIOS[0],
          col_timestamp=DEFAULT_TIMESTAMP_COL,
      )
  
      assert splits[0].count() / NUM_ROWS == pytest.approx(
          RATIOS[0], TOL
      )
      assert splits[1].count() / NUM_ROWS == pytest.approx(
          1 - RATIOS[0], TOL
      )
  
      max_split0 = (
          splits[0].agg(F.max(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      min_split1 = (
          splits[1].agg(F.min(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      assert max_split0 <= min_split1
  
      # Test multi split
      splits = spark_timestamp_split(dfs_rating, ratio=RATIOS)
  
      assert splits[0].count() / NUM_ROWS == pytest.approx(
          RATIOS[0], TOL
      )
      assert splits[1].count() / NUM_ROWS == pytest.approx(
          RATIOS[1], TOL
      )
      assert splits[2].count() / NUM_ROWS == pytest.approx(
          RATIOS[2], TOL
      )
  
      max_split0 = (
          splits[0].agg(F.max(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      min_split1 = (
          splits[1].agg(F.min(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      assert max_split0 <= min_split1
  
      max_split1 = (
          splits[1].agg(F.max(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      min_split2 = (
          splits[2].agg(F.min(DEFAULT_TIMESTAMP_COL)).first()[0]
      )
      assert max_split1 <= min_split2
  
file_path: recommenders/tests/unit/recommenders/datasets/test_spark_splitter.py
imports: import pytest
  import numpy
  import pandas
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL
label_desc: Use image node_id 7 for calling a global function with example usage: test_timestamp_splitter(spark_dataset) without return types