I use boto to access the dynamodb table. Everything went well until I tried to perform a scan operation.
I tried a couple of syntaxes that I found after doing repeated searches on the internet but with no luck:
def scanAssets(self, asset): results = self.table.scan({('asset', 'EQ', asset)}) -or- results = self.table.scan(scan_filter={'asset':boto.dynamodb.condition.EQ(asset)})
The attribute I'm viewing is called an asset, and the asset is a string.
Odd is the call to table.scan, which always ends through this function:
def dynamize_scan_filter(self, scan_filter): """ Convert a layer2 scan_filter parameter into the structure required by Layer1. """ d = None if scan_filter: d = {} for attr_name in scan_filter: condition = scan_filter[attr_name] d[attr_name] = condition.to_dict() return d
I am not a python expert, but I do not understand how this will work. That is, what structure will scan_filter have to go through this code?
Again, maybe I'll just call it wrong. Any suggestions?
source share