title: Type mismatch for key data expected: S actual: L Dynamodb insert error with boto3
body: <p>I have the following script for inserting the json files to DynamoDb table:</p>
  
  <pre><code>import os
  import boto3
  import json
  
  region = '&lt;&gt;'
  image = 'ami-&lt;&gt;'
  ubuntu_image = 'ami-&lt;&gt;'
  keyname = '&lt;&gt;'
  AWS_ACCESS_KEY_ID = '&lt;&gt;'
  AWS_SECRET_ACCESS_KEY = '&lt;&gt;'
  
  
  def dynamo(path):
      session = boto3.Session(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
      dynamo = session.resource('dynamodb')
      table = dynamo.Table('&lt;&gt;')
  
      for filename in os.listdir(path):
          with open(path + '/' + filename) as data_file:
              data = json.loads(data_file.read())
              print data
              table.put_item(
                             Item={
                                  'filename': filename,
                                  'data': data,
                              }
                          )      
  
          print filename
  
  
  
  print dynamo('&lt;&gt;')
  </code></pre>
  
  <p>I am getting the following error, when attempting to do so: </p>
  
  <pre><code>botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutItem operation: One or more parameter values were invalid: Type mismatch for key data expected: S actual: L
  </code></pre>
  
  <p>One of the json files is:</p>
  
  <pre><code>[{"text": "Vasovagal syncope", "type": "DX_LSTM", "end": 103, "assertion": 1, "start": 86}, {"text": "Traumatic arthritis", "type": "DX_LSTM", "end": 145, "assertion": 1, "start": 126}, {"text": "right knee", "type": "DX_LSTM", "end": 157, "assertion": 1, "start": 147}, {"text": "Hypertension", "type": "DX_LSTM", "end": 174, "assertion": 1, "start": 162}, {"text": "urinary tract infection", "type": "DX_LSTM", "end": 223, "assertion": 1, "start": 200}, {"text": "renal carcinoma", "type": "DX_LSTM", "end": 254, "assertion": 1, "start": 239}, {"text": "obstructive pulmonary disease", "type": "DX_LSTM", "end": 315, "assertion": 1, "start": 286}, {"text": "stroke", "type": "DX_LSTM", "end": 442, "assertion": 1, "start": 436}, {"text": "hypertension", "type": "DX_LSTM", "end": 456, "assertion": 1, "start": 444}, {"text": "COPD", "type": "DX_LSTM", "end": 462, "assertion": 1, "start": 458}, {"text": "renal carcinoma", "type": "DX_LSTM", "end": 487, "assertion": 1, "start": 472}, {"text": "syncope", "type": "DX_LSTM", "end": 533, "assertion": 1, "start": 526}, {"text": "fell to her knees", "type": "DX_LSTM", "end": 584, "assertion": 1, "start": 567}, {"text": "hit her head on the ground, near", "type": "DX_LSTM", "end": 625, "assertion": 1, "start": 593}, {"text": "loss of consciousness", "type": "DX_LSTM", "end": 725, "assertion": 0, "start": 704}, {"text": "falls", "type": "DX_LSTM", "end": 804, "assertion": 1, "start": 799}, {"text": "hip fracture", "type": "DX_LSTM", "end": 845, "assertion": 1, "start": 833}, {"text": "bruising around the left eye", "type": "DX_LSTM", "end": 967, "assertion": 1, "start": 939}, {"text": "decreased mobility of", "type": "DX_LSTM", "end": 1085, "assertion": 1, "start": 1064}, {"text": "left", "type": "DX_LSTM", "end": 1094, "assertion": 1, "start": 1090}, {"text": "syncope", "type": "DX_LSTM", "end": 1175, "assertion": 0, "start": 1168}, {"text": "stroke", "type": "DX_LSTM", "end": 1195, "assertion": 0, "start": 1189}, {"text": "fractures", "type": "DX_LSTM", "end": 1348, "assertion": 0, "start": 1339}, {"text": "left humeral head", "type": "DX_LSTM", "end": 1405, "assertion": 0, "start": 1388}, {"text": "neck fracture", "type": "DX_LSTM", "end": 1423, "assertion": 0, "start": 1410}, {"text": "baseline anterior dislocation", "type": "DX_LSTM", "end": 1458, "assertion": 1, "start": 1429}, {"text": "changes", "type": "DX_LSTM", "end": 1500, "assertion": 0, "start": 1493}, {"text": "left periorbital soft tissue swelling", "type": "DX_LSTM", "end": 1539, "assertion": 0, "start": 1502}, {"text": "soft tissue", "type": "DX_BLME", "end": 1530, "assertion": 0, "start": 1519}, {"text": "facial bone fracture", "type": "DX_LSTM", "end": 1600, "assertion": 0, "start": 1580}, {"text": "ventricular function", "type": "DX_LSTM", "end": 1656, "assertion": 1, "start": 1636}, {"start": 1774, "end": 1782, "text": "syncopal", "type": "DX_LSTM", "assertion": 0}, {"text": "orthostatic", "type": "DX_LSTM", "end": 1865, "assertion": 1, "start": 1854}, {"text": "walk", "type": "DX_LSTM", "end": 2021, "assertion": 1, "start": 2017}, {"text": "traumatic injury of her knee", "type": "DX_LSTM", "end": 2072, "assertion": 1, "start": 2044}, {"text": "injury", "type": "DX_Exact", "end": 2060, "assertion": 1, "start": 2054}, {"text": "pain", "type": "DX_LSTM", "end": 2098, "assertion": 1, "start": 2094}, {"text": "swelling", "type": "DX_LSTM", "end": 2111, "assertion": 1, "start": 2103}, {"text": "fractures", "type": "DX_LSTM", "end": 2154, "assertion": 0, "start": 2145}, {"text": "frail", "type": "DX_LSTM", "end": 2175, "assertion": 0, "start": 2170}]
  </code></pre>