title: Partition Key bad request when adding data to a container - python
body: <p>So I've been going through the tutorial code for cosmodb in python to have better understanding with it, and currently am stuck on an issue with the partition key when trying to add data.</p>
  <p>This code creates the container object, with a partition key called <code>account_number</code>.</p>
  <pre><code>container = db.create_container(id=CONTAINER_ID, partition_key=PartitionKey(path='/account_number') ,offer_throughput=400)
  </code></pre>
  <p>Here is some dummy data:</p>
  <pre><code>def get_sales_order(item_id):
      order1 = {'id' : item_id,
              'account_number' : 'Account1',
              'purchase_order_number' : 'PO18009186470',
              'order_date' : datetime.date(2005,1,10).strftime('%c'),
              'subtotal' : 419.4589,
              'tax_amount' : 12.5838,
              'freight' : 472.3108,
              'total_due' : 985.018,
              'items' : [
                  {'order_qty' : 1,
                      'product_id' : 100,
                      'unit_price' : 418.4589,
                      'line_price' : 418.4589
                  }
                  ],
              'ttl' : 60 * 60 * 24 * 30
              }
  
      return order1
  </code></pre>
  <p>When trying to run the following code to add the dummy data into the db I use the following:</p>
  <pre><code>sales_order = get_sales_order(&quot;SalesOrder1&quot;)
  container.create_item(body = sales_order)
  </code></pre>
  <p>When I run this I get the following error message.</p>
  <pre><code>(BadRequest) Message: {&quot;Errors&quot;:[&quot;The partition key supplied in x-ms-partitionkey header has fewer components than defined in the collection.&quot;]}
  </code></pre>
  <p>After looking at the documentation for the create_item method, I noticed the <code>initial_headers</code> param. So I created a dict with the necessary info as seen here:</p>
  <pre><code>headers = {}
  headers[&quot;x-ms-documentdb-partitionkey&quot;]= &quot;account_number&quot;
  </code></pre>
  <p>Next I ran the following code with the addition of the `&quot;x-ms-documentdb-partitionkey&quot; header.</p>
  <pre><code>container.create_item(body = sales_order, initial_headers = headers)
  </code></pre>
  <p>However I still receive the same error. Help is very much appreciated.</p>