My current code to assign a boolean value to my pyspark dataframe is:
df = df.withColumn('my_column_name', True)
However, I get the error: "AssertionError: col should be Column"
Do I need to have "True" value wrapped with col(BooleanType(True))? I don't think I should be casting it as a lit string
You can try:
df = df.withColumn("my_column_name", F.lit(1).cast('boolean'))