__init__.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cruddy 作者: Min-ops 项目源码 文件源码
def _analyze_table(self):
        # First check the Key Schema
        if len(self.table.key_schema) != 1:
            LOG.info('cruddy does not support RANGE keys')
        else:
            self._indexes[self.table.key_schema[0]['AttributeName']] = None
        # Now process any GSI's
        if self.table.global_secondary_indexes:
            for gsi in self.table.global_secondary_indexes:
                # find HASH of GSI, that's all we support for now
                # if the GSI has a RANGE, we ignore it for now
                if len(gsi['KeySchema']) == 1:
                    gsi_hash = gsi['KeySchema'][0]['AttributeName']
                    self._indexes[gsi_hash] = gsi['IndexName']

    # Because the Boto3 DynamoDB client turns all numeric types into Decimals
    # (which is actually the right thing to do) we need to convert those
    # Decimal values back into integers or floats before serializing to JSON.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号