code: def test_determine_transform_to_use():
      # Test that _determine_transform_to_use doesn't throw any exceptions
      # and selects the transform function of the underlying preprocessor
      # while dealing with the nested Chain case.
  
      # Check that error is propagated correctly
      with pytest.raises(NotImplementedError):
          chain = Chain(PreprocessorWithoutTransform())
          chain._determine_transform_to_use()
  
      # Should have no errors from here on
      preprocessor = SimpleImputer(["A"])
      chain1 = Chain(preprocessor)
      format1 = chain1._determine_transform_to_use()
      assert format1 == BatchFormat.PANDAS
  
      chain2 = Chain(chain1)
      format2 = chain2._determine_transform_to_use()
  
      assert format1 == format2
  
file_path: ray/python/ray/data/tests/preprocessors/test_chain.py
imports: import pandas
  import pytest
  import ray
  from ray.air.util.data_batch_conversion import BatchFormat
  from ray.data.preprocessor import Preprocessor
  from ray.data.preprocessors import BatchMapper, Chain, LabelEncoder, SimpleImputer, StandardScaler
label_desc: Use image node_id 4 for calling a global function with example usage: test_determine_transform_to_use() without return types