I am writing unit tests for a Spark job, and some of the outputs are named tuples: pyspark.sql.Row
How can I assert their equality?
actual = get_data(df)
expected = Row(total=4, unique_ids=2)
self.assertEqual(actual, expected)
When I do this, the values are rearranged in an order I can not determine.