Fix the test and make the to_spark_sql thing work