Hi, I'm trying to write a short function that returns the last sunday of the week of a given date, code below
def getSunday(day): day = day.cast("date") sun = next_day(day, "Sunday") n = datediff(sun,day) if (n == 7): return day else: return sun this gives me ValueError: Cannot convert column into bool: Can someone point out what I am doing wrong thanks -- Franc