spark_test.py reduction