ストアからの行の削除
 Store.delete()メソッドを使用して、1つの行をストアから削除します。行は、削除する行の完全な主キーを定義するディクショナリに基づいて削除されます。削除される前に、行が指定されたバージョンに一致することを求めることもできます。これを行うには、Store.delete_if_version()メソッドを使用します。バージョンについては、「行バージョンの使用」で説明します。 
                  
行を削除する場合、ストアへの書込み操作で発生するのと同じ例外に対処する必要があります。これらの例外の概要は、書込みの例外を参照してください。
try:
    # To delete a table row, just include a dictionary
    # that contains all the fields needed to create
    # the primary key.
    primary_key_d = {"item" : "bolts"}
    ret = store.delete("myTable", primary_key_d)
    if ret[0]:
        logging.debug("Row deletion succeeded")
    else:
        logging.debug("Row deletion failed.")
except IllegalArgumentException, iae:
    logging.error("Row deletion failed.")
    logging.error(iae.message) multi_delete()の使用方法
複数の行ですべてシャード・キー値を共有している場合、1回の原子的操作で一度に複数の行を削除できます。シャード・キーが少なくとも主キーのサブセットではあることを思い出してください。この場合、複数削除を実行するために、シャード・キーである部分主キーが使用されます。
 複数の行を一度に削除するには、Store.multi_delete()メソッドを使用します。 
                     
たとえば、次のような表を作成するとします。
CREATE TABLE myTable (
    itemType STRING,
    itemCategory STRING,
    itemClass STRING,
    itemColor STRING,
    itemSize STRING,
    price FLOAT,
    inventoryCount INTEGER,
    PRIMARY KEY (SHARD(itemType, itemCategory, itemClass), itemColor,
    itemSize)
) 次のようなデータを含む表:
-  
                           行1: - 
                                 itemType: Hats 
- 
                                 itemCategory: baseball 
- 
                                 itemClass: longbill 
- 
                                 itemColor: red 
- 
                                 itemSize: small 
- 
                                 price: 12.07 
- 
                                 inventoryCount: 127 
 
- 
                                 
-  
                           行2: - 
                                 itemType: Hats 
- 
                                 itemCategory: baseball 
- 
                                 itemClass: longbill 
- 
                                 itemColor: red 
- 
                                 itemSize: medium 
- 
                                 price: 13.07 
- 
                                 inventoryCount: 201 
 
- 
                                 
-  
                           行3: - 
                                 itemType: Hats 
- 
                                 itemCategory: baseball 
- 
                                 itemClass: longbill 
- 
                                 itemColor: red 
- 
                                 itemSize: large 
- 
                                 price: 14.07 
- 
                                 inventoryCount: 39 
 
- 
                                 
 この場合、次のように、部分主キーHats、baseball、longbillを共有するすべての行を削除できます。 
                     
try:
    primary_key_d = {'itemType'     : 'Hats',
                     'itemCategory' : 'baseball',
                     'itemClass'    : 'longbill'}
    ret = store.multi_delete("myTable", primary_key_d)
    if ret > 0:
        logging.debug("%s rows deleted" % ret)
    else:
        logging.debug("No rows deleted.")
except IllegalArgumentException, iae:
    logging.error("Row deletion failed.")
    logging.error(iae.message)