code: def test_spark_udf_spark_connect_with_model_logging(spark, tmp_path):
      X, y = load_iris(return_X_y=True, as_frame=True)
      model = LogisticRegression().fit(X, y)
  
      mlflow.set_tracking_uri(tmp_path.joinpath("mlruns").as_uri())
      mlflow.set_experiment("test")
      with mlflow.start_run():
          signature = mlflow.models.infer_signature(X, y)
          model_info = mlflow.sklearn.log_model(
              model, "model", signature=signature
          )
  
      udf = mlflow.pyfunc.spark_udf(
          spark, model_info.model_uri, env_manager="local"
      )
      X_test = X.head(5)
      sdf = spark.createDataFrame(X_test)
      preds = sdf.select(
          udf(*X_test.columns).alias("preds")
      ).toPandas()["preds"]
      np.testing.assert_array_almost_equal(preds, model.predict(X_test))
  
file_path: mlflow/tests/pyfunc/test_spark_connect.py
imports: import numpy
  import pandas
  import pyspark
  import pytest
  from pyspark.sql import SparkSession
  from sklearn.datasets import load_iris
  from sklearn.linear_model import LogisticRegression
  import mlflow
label_desc: Use image node_id 4 for calling a global function with example usage: test_spark_udf_spark_connect_with_model_logging(spark, tmp_path) without return types