jlafon/PynamoDB — pull request #21 by silvexis (2014-05-15 00:46:10+00:00)
Title: 	modified:   pynamodb/connection/base.py

The following ensures the key_schema in indexes is sorted appropriately because AWS's API requires the HASH key to come first. Depending on how the stars align, you may or may not end up with your local or global index key_schema out of order resulting in the following error when creating your table:

pynamodb.exceptions.TableError: Failed to create table: {"__type":"com.amazon.coral.validate#ValidationException","message":"Invalid KeySchema: The first KeySchemaElement is not a HASH key type"