title: TypeError: Invalid argument, not a string or column: pyspark UDFs
body: <p>i am  creating a spark UDF inside a class. when i execute the below code i am getting exception.</p>
  
  <pre><code>class A(B):
  def __init__(self,spark):
  
      B.__init__(self)
  
      self.spark = spark
  
  
  
  def process(self, df):
      df = df.withColumn("col_sub_entry", self.conditions_title("entry_title"))
  
  def conditions_entry_title(self,x:StringType()):
      if len(x.split(" ") &lt; 3):
          return 0
      else :
          return x
  conditions_title = udf(conditions_entry_title, IntegerType())
  </code></pre>