code: def test_spark_udf(basic_model, spark):
      params = {"batch_size": 16}
      with mlflow.start_run():
          signature = infer_signature(
              SENTENCES, basic_model.encode(SENTENCES), params
          )
          model_info = mlflow.sentence_transformers.log_model(
              basic_model, "my_model", signature=signature
          )
  
      result_type = ArrayType(DoubleType())
      loaded_model = mlflow.pyfunc.spark_udf(
          spark,
          model_info.model_uri,
          result_type=result_type,
          params=params,
      )
  
      df = spark.createDataFrame(
          [("hello MLflow",), ("bye world",)], ["text"]
      )
      df = df.withColumn("embedding", loaded_model("text"))
      assert df.schema[1].dataType == result_type
  
      pdf = df.toPandas()
      assert pdf.shape == (2, 2)
      assert pdf["embedding"].dtype == "object"
  
      embeddings = np.array(pdf.embedding.to_list())
      assert embeddings.shape == (
          2,
          basic_model.get_sentence_embedding_dimension(),
      )
  
imports: import json
  import os
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import yaml
  from pyspark.sql import SparkSession
  from pyspark.sql.types import ArrayType, DoubleType
  from sentence_transformers import SentenceTransformer
  import mlflow
  import mlflow.pyfunc.scoring_server
  import mlflow.sentence_transformers
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model, infer_signature
  from mlflow.models.utils import _read_example
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.utils.environment import _mlflow_conda_env
  from tests.helper_functions import _assert_pip_requirements, _compare_logged_code_paths, _mlflow_major_version_string, assert_register_model_called_with_local_model_path, pyfunc_serve_and_score_model
label_desc: Use image node_id 19 for calling a global function with example usage: test_spark_udf(basic_model, spark) without return types