cuteabhi32
New Contributor III

AttributeError: 'DataFrame' object has no attribute 'ColumnChecker'

def func_udf(df,col):

  column =list(df.columns)

  if col in column:

    return df.col

  else:

     df.withColumn("col", lit(null))

spark.udf.register("ColumnChecker",func_udf)

dfg=a.ColumnChecker(a,ref_date)

dfg.show()

this is the code i am running