title: AWS DynamoDB Python - boto3 Key() methods not recognized (Query)
body: <p>I am using Lambda (Python) to query my DynamoDB database.  I am using the boto3 library, and I was able to make an "equivalent" query:</p>
  
  <p>This script works:</p>
  
  <pre><code>import boto3
  from boto3.dynamodb.conditions import Key, Attr
  import json
  
  def create_list(event, context):
      resource = boto3.resource('dynamodb')
      table = resource.Table('Table_Name')
  
      response = table.query(
          TableName='Table_Name',
          IndexName='Custom-Index-Name',
          KeyConditionExpression=Key('Number_Attribute').eq(0)
      )
      return response
  </code></pre>
  
  <p>However, when I change the query expression to this:</p>
  
  <pre><code>KeyConditionExpression=Key('Number_Attribute').gt(0)
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>"errorType": "ClientError",
    "errorMessage": "An error occurred (ValidationException) when calling the Query operation: Query key condition not supported"
  </code></pre>
  
  <p>According to this [1] resource, "gt" is a method of Key().  Does anyone know if this library has been updated, or what other methods are available other than "eq"?</p>
  
  <p>[1] <a href="http://boto3.readthedocs.io/en/latest/reference/customizations/dynamodb.html#ref-dynamodb-conditions" rel="noreferrer">http://boto3.readthedocs.io/en/latest/reference/customizations/dynamodb.html#ref-dynamodb-conditions</a></p>
  
  <p><strong><em>---------EDIT----------</em></strong></p>
  
  <p>I also just tried the old method using:</p>
  
  <pre><code>response = client.query(
          TableName = 'Table_Name',
          IndexName='Custom_Index',
          KeyConditions = {
              'Custom_Number_Attribute':{
                  'ComparisonOperator':'EQ',
                  'AttributeValueList': [{'N': '0'}]
              }
          }
      )
  </code></pre>
  
  <p>This worked, but when I try:</p>
  
  <pre><code>response = client.query(
              TableName = 'Table_Name',
              IndexName='Custom_Index',
              KeyConditions = {
                  'Custom_Number_Attribute':{
                      'ComparisonOperator':'GT',
                      'AttributeValueList': [{'N': '0'}]
                  }
              }
          )
  </code></pre>
  
  <p>...it does not work.</p>
  
  <p>Why would EQ be the only method working in these cases?  I'm not sure what I'm missing in the documentation.</p>