class_docstr: A feature transformer that merges multiple input columns into an array type column.
  
  Parameters
  ----------
  You need to set param `inputCols` for specifying input column names,
  and set param `featureSizes` for specifying corresponding input column
  feature size, for scalar type input column, corresponding feature size must be set to 1,
  otherwise, set corresponding feature size to feature array length.
  Output column is "array<double"> type and contains array of assembled features.
  All elements in input feature columns must be convertible to double type.
  
  You can set 'handler_invalid' param to specify how to handle invalid input value
  (None or NaN), if it is set to 'error', error is thrown for invalid input value,
  if it is set to 'keep', it returns relevant number of NaN in the output.
  
  .. versionadded:: 4.0.0
  
  Examples
  --------
  >>> from pyspark.ml.connect.feature import ArrayAssembler
  >>> import numpy as np
  >>>
  >>> spark_df = spark.createDataFrame(
  ...     [
  ...         ([2.0, 3.5, 1.5], 3.0, True, 1),
  ...         ([-3.0, np.nan, -2.5], 4.0, False, 2),
  ...     ],
  ...     schema=["f1", "f2", "f3", "f4"],
  ... )
  >>> assembler = ArrayAssembler(
  ...     inputCols=["f1", "f2", "f3", "f4"],
  ...     outputCol="out",
  ...     featureSizes=[3, 1, 1, 1],
  ...     handleInvalid="keep",
  ... )
  >>> assembler.transform(spark_df).select("out").show(truncate=False)
class_docstr_tok: ["A","feature","transformer","that","merges","multiple","input","columns","into","an","array","type","column",".","Parameters","--","--","--","--","--","You","need","to","set","param","`","inputCols","`","for","specifying","input","column","names",",","and","set","param","`","featureSizes","`","for","specifying","corresponding","input","column","feature","size",",","for","scalar","type","input","column",",","corresponding","feature","size","must","be","set","to","1",",","otherwise",",","set","corresponding","feature","size","to","feature","array","length",".","Output","column","is","``","array","<","double","''",">","type","and","contains","array","of","assembled","features",".","All","elements","in","input","feature","columns","must","be","convertible","to","double","type",".","You","can","set","'handler_invalid","'","param","to","specify","how","to","handle","invalid","input","value","(","None","or","NaN",")",",","if","it","is","set","to","'error","'",",","error","is","thrown","for","invalid","input","value",",","if","it","is","set","to","'keep","'",",","it","returns","relevant","number","of","NaN","in","the","output",".","..","versionadded",":",":","4.0.0","Examples","--","--","--","--",">",">",">","from","pyspark.ml.connect.feature","import","ArrayAssembler",">",">",">","import","numpy","as","np",">",">",">",">",">",">","spark_df","=","spark.createDataFrame","(","...","[","...","(","[","2.0",",","3.5",",","1.5","]",",","3.0",",","True",",","1",")",",","...","(","[","-3.0",",","np.nan",",","-2.5","]",",","4.0",",","False",",","2",")",",","...","]",",","...","schema=","[","``","f1","''",",","``","f2","''",",","``","f3","''",",","``","f4","''","]",",","...",")",">",">",">","assembler","=","ArrayAssembler","(","...","inputCols=","[","``","f1","''",",","``","f2","''",",","``","f3","''",",","``","f4","''","]",",","...","outputCol=","''","out","''",",","...","featureSizes=","[","3",",","1",",","1",",","1","]",",","...","handleInvalid=","''","keep","''",",","...",")",">",">",">","assembler.transform","(","spark_df",")",".select","(","``","out","''",")",".show","(","truncate=False",")"]
code: def _get_transform_fn(self) -> Callable[..., Any]:
      feature_size_list = self.getFeatureSizes()
      if feature_size_list is None or len(feature_size_list) != len(
          self.getInputCols()
      ):
          raise ValueError(
              "'feature_size_list' param must be set with an array of integer, and"
              "its length must be equal to number of input columns."
          )
      for feature_size in feature_size_list:
          if feature_size <= 0:
              raise ValueError(
                  "All input feature sizes must be an positive integer."
              )
  
      assembled_feature_size = sum(feature_size_list)
      handler_invalid = self.getHandleInvalid()
  
      if handler_invalid not in ["error", "keep"]:
          raise ValueError(
              "'handler_invalid' param must be set with 'error' or 'keep' value."
          )
  
      keep_invalid = handler_invalid == "keep"
  
      def assemble_features(*feature_list: Any) -> Any:
          assembled_array = np.empty(
              assembled_feature_size, dtype=np.float64
          )
          pos = 0
          for index, feature in enumerate(feature_list):
              feature_size = feature_size_list[index]
  
              if feature is not None:
                  if np.isscalar(feature) and feature_size != 1:
                      raise ValueError(
                          f"The {index + 1}th input feature is a scalar value, but provided "
                          f"feature size is {feature_size}."
                      )
                  if (
                      not np.isscalar(feature)
                      and len(feature) != feature_size
                  ):
                      raise ValueError(
                          f"The {index + 1}th input feature size does not match "
                          f"with provided feature size {feature_size}."
                      )
              if keep_invalid:
                  if feature is None:
                      assembled_array[pos : pos + feature_size] = np.nan
                  else:
                      assembled_array[
                          pos : pos + feature_size
                      ] = feature
              else:
                  if feature is None or np.isnan(feature).any():
                      raise ValueError(
                          f"The input features contains invalid value: {str(feature)}"
                      )
                  else:
                      assembled_array[
                          pos : pos + feature_size
                      ] = feature
  
              pos += feature_size
  
          return assembled_array
  
      def transform_fn(*series_list: Any) -> Any:
          return pd.Series(
              assemble_features(*feature_list)
              for feature_list in zip(*series_list)
          )
  
      return transform_fn
  
imports: import pickle
  from typing import Any, Union, List, Tuple, Callable, Dict, Optional
  import numpy
  import pandas
  from pyspark import keyword_only
  from pyspark.sql import DataFrame
  from pyspark.ml.param.shared import HasInputCol, HasInputCols, HasOutputCol, HasFeatureSizes, HasHandleInvalid, Param, Params, TypeConverters
  from pyspark.ml.connect.base import Estimator, Model, Transformer
  from pyspark.ml.connect.io_utils import ParamsReadWrite, CoreModelReadWrite
  from pyspark.ml.connect.summarizer import summarize_dataframe
label_desc: Use image node_id 4 for calling the ArrayAssembler obj's underlying member method code with example usage: obj._get_transform_fn() and returns: transform_fn, assembled_array, pd