title: How to pass multi columns as parameters to pyspark write repartition()
body: <p>I have created a function that writes out a dataframe to an s3 location with some parameters. All works except for re-partition list parameter. It fails with the error: <code>raise TypeError("numPartitions should be an int or Column")</code></p>
  
  <p>The year is an int column and the date is a sate type column. When I hard-code the 2 columns as 
  <code>.repartition("parti_create_date", "parti_hour")</code>  it works. 
  I tried supplying them as a list, string, and col. 
  Nothing seems to work.</p>
  
  <pre><code>parti_list = ["parti_year", "parti_create_date", "parti_hour"]
  re_parti_list = ["parti_create_date", "parti_hour"]
  
  def spark_write(in_df, write_tgt_loc, parti_list, re_parti_list, tgt_file_format, write_mode, tgt_file_compression):
  (in_df
              .repartition(re_parti_list)  #(re_parti_str)
              .write
              .partitionBy(parti_str)
              .mode(write_mode).format(tgt_file_format)
              .option('compression', tgt_file_compression).option("nullValue", "null").option("treatEmptyValuesAsNulls,", "true")
              .save(write_tgt_loc))
  
  spark_write(tgt_df, "s3://bucket/out/", parti_list, re_parti_list, "parquet", "overwrite","snappy")
  </code></pre>
  
  <p>Can you please help me figure out how to pass the re-partition columns as parameters in PySpark?</p>