code: def testModelSerializationInPipeline():
      spark = test_helpers.getOrCreateSparkSession(
          test_helpers.getCurrentMethodName()
      )
      import catboost_spark
  
      srcData = [
          Row(0.12, "query0", 0.1, "Male", 0.2, "Germany", 0.11),
          Row(0.22, "query0", 0.97, "Female", 0.82, "Russia", 0.33),
          Row(0.34, "query1", 0.13, "Male", 0.22, "USA", 0.23),
          Row(0.42, "Query 2", 0.14, "Male", 0.18, "Finland", 0.1),
          Row(0.01, "Query 2", 0.9, "Female", 0.67, "USA", 0.17),
          Row(0.0, "Query 2", 0.66, "Female", 0.1, "UK", 0.31),
      ]
      srcDataSchema = [
          StructField("Label", DoubleType()),
          StructField("GroupId", StringType()),
          StructField("float0", DoubleType()),
          StructField("Gender1", StringType()),
          StructField("float2", DoubleType()),
          StructField("Country3", StringType()),
          StructField("float4", DoubleType()),
      ]
  
      df = spark.createDataFrame(
          spark.sparkContext.parallelize(srcData),
          StructType(srcDataSchema),
      )
  
      indexers = [
          StringIndexer(
              inputCol=catFeature, outputCol=catFeature + "Index"
          )
          for catFeature in ["Gender1", "Country3"]
      ]
      assembler = VectorAssembler(
          inputCols=[
              "float0",
              "Gender1Index",
              "float2",
              "Country3Index",
              "float4",
          ],
          outputCol="features",
      )
      classifier = catboost_spark.CatBoostRegressor(
          labelCol="Label", iterations=20
      )
  
      pipeline = Pipeline(stages=indexers + [assembler, classifier])
      pipelineModel = pipeline.fit(df)
  
      serializationDir = tempfile.mkdtemp(
          prefix=test_helpers.getCurrentMethodName()
      )
  
      modelPath = os.path.join(
          serializationDir, "serialized_pipeline_model"
      )
  
      pipelineModel.write().overwrite().save(modelPath)
      loadedPipelineModel = PipelineModel.load(modelPath)
  
      print("predictions")
      pipelineModel.transform(df).show(truncate=False)
  
      print("predictionsLoaded")
      loadedPipelineModel.transform(df).show(truncate=False)
  
      shutil.rmtree(serializationDir)
  
imports: import collections
  import datetime
  import os
  import shutil
  import tempfile
  import test_helpers
  import pool_test_helpers
  from pyspark.ml import Pipeline, PipelineModel
  from pyspark.ml.feature import StringIndexer, VectorAssembler
  from pyspark.ml.linalg import Vectors, VectorUDT
  from pyspark.sql import Row
  from pyspark.sql.types import *
label_desc: Use image node_id 10 for calling a global function with example usage: testModelSerializationInPipeline() without return types