title: How to limit max number of partitions in scope of partitioning by column
body: <p>I have a PySpark dataframe like:</p>
  <pre><code>City  SomeValue
  
  NY     5
  NY     4   
  WA     1
  WA     3
  CA     7
  SF     8
  </code></pre>
  <p>I want to write it to for example 2 files, but all records with the same value of City should be in the same file (number of files should be less than number of unique cities). How can I do it using pySpark?</p>