code: def test_datetime_split(format, df_engine, ray_cluster_2cpu):
      nrows = 100
      npartitions = 10
  
      df = pd.DataFrame(
          np.random.randint(0, 100, size=(nrows, 3)),
          columns=["A", "B", "C"],
      )
  
      def random_date(*args, **kwargs):
          start = datetime.strptime(
              "1/1/1990 1:30 PM", "%m/%d/%Y %I:%M %p"
          )
          end = datetime.strptime(
              "1/1/2022 4:50 AM", "%m/%d/%Y %I:%M %p"
          )
          delta = end - start
          int_delta = (delta.days * 24 * 60 * 60) + delta.seconds
          random_second = randrange(int_delta)
          t = start + timedelta(seconds=random_second)
          return str(t) if format == "str" else t
  
      df["date_col"] = df["C"].map(random_date)
  
      if isinstance(df_engine, DaskEngine):
          df = df_engine.df_lib.from_pandas(df, npartitions=npartitions)
  
      probs = (0.7, 0.1, 0.2)
      split_params = {
          "type": "datetime",
          "column": "date_col",
          "probabilities": probs,
      }
      splitter = get_splitter(**split_params)
  
      backend = Mock()
      backend.df_engine = df_engine
      splits = splitter.split(df, backend)
  
      assert len(splits) == 3
  
      min_datestr = "1990-01-01 00:00:00"
      for split, p in zip(splits, probs):
          if isinstance(df_engine, DaskEngine):
              # Dask splitting is not exact, so apply soft constraint here
              split = split.compute()
              assert len(split) >= 1
              # Dask splitting is not exact, so we can potentially apply soft constraint. However, this can also be flaky:
              # https://github.com/ludwig-ai/ludwig/actions/runs/4590907163/jobs/8106746310?pr=3315.
              # assert np.isclose(len(split), int(nrows * p), atol=15)
          else:
              assert len(split) == int(nrows * p)
  
          assert np.all(split["date_col"] > min_datestr)
          min_datestr = split["date_col"].max()
  
file_path: ludwig/tests/ludwig/data/test_split.py
imports: from datetime import datetime, timedelta
  from itertools import combinations
  from random import randrange
  from unittest.mock import Mock
  import numpy
  import pandas
  import pytest
  from ludwig.data.dataframe.pandas import PandasEngine
  from ludwig.data.split import get_splitter
label_desc: Use image node_id 7 for calling a global function with example usage: test_datetime_split(format, df_engine, ray_cluster_2cpu) and returns: unknown