title: How to compare two PySpark columns with Pytest, without using dataframes?
body: <p>A have a situation where I need to compare the columns before I create the dataframe for a test suit, something like that:</p>
  <pre><code>import pytest
  import pyspark.sql.functions as F
  
  def first_test():
      c1 = F.col(&quot;First Column&quot;).alias(&quot;1st Column&quot;)
      c2 = F.col(&quot;Second Column&quot;).alias(&quot;2nd Column&quot;)
      c3 = F.col(&quot;Second Column&quot;).alias(&quot;2nd Column&quot;)
  
      print(c1)
      print(c2)
      print(c3)
  
      assert c1 != c2
      assert c2 == c3
  </code></pre>
  <p>Once I run pytest with -s and -vv options I see the following:</p>
  <pre><code>Column&lt;'`First Column` AS `1st Column'&gt;
  Column&lt;'`Second Column` AS `2nd Column`'&gt;
  Column&lt;'`Second Column` AS `2nd Column`'&gt;
  
  self = Column&lt;'(`First Column` AS `1st Column` = `Second Column` AS `2nd Column`)'&gt;
  
      def __nonzero__(self) -&gt; None:
          raise ValueError(
  &gt;           &quot;Cannot convert column into bool: please use '&amp;' for 'and', '|' for 'or', &quot;
              &quot;'~' for 'not' when building DataFrame boolean expressions.&quot;
          )
  E       ValueError: Cannot convert column into bool: please use '&amp;' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions.
  </code></pre>
  <p>The same error if I comment the first assertion (c1==c2) and keep only the second (c2==c3).</p>
  <p>How can I assert that 2 columns are the same in this simple case scenario?</p>