title: New column comparing dates in PySpark
body: <p>I am struggling to create a new column based off a simple condition comparing two dates. I have tried the following:</p>
  <pre><code>.withColumn(&quot;terms&quot;, when(col(&quot;start_date&quot;) &lt;= col(&quot;end_date&quot;)), col(&quot;sarter_terms&quot;)).otherwise(col(&quot;exp_terms&quot;)) \
  </code></pre>
  <p>Which yields a syntax error.</p>
  <p>I have also updated as follows:</p>
  <pre><code>.withColumn(&quot;terms&quot;, when(col(&quot;start_date&quot;).leq(col(&quot;end_date&quot;))), col(&quot;sarter_terms&quot;)).otherwise(col(&quot;exp_terms&quot;)) \
  </code></pre>
  <p>But this yields a Python error that the Column is not callable.</p>
  <p>How would I create a new column that dynamically adjusts based on whether the date comparator holds.</p>