test_sql.py 文件源码

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

项目:PyDataLondon29-EmbarrassinglyParallelDAWithAWSLambda 作者: SignalMedia 项目源码 文件源码
def _get_index_columns(self, tbl_name):
        ixs = sql.read_sql_query(
            "SHOW INDEX IN %s" % tbl_name, self.conn)
        ix_cols = {}
        for ix_name, ix_col in zip(ixs.Key_name, ixs.Column_name):
            if ix_name not in ix_cols:
                ix_cols[ix_name] = []
            ix_cols[ix_name].append(ix_col)
        return list(ix_cols.values())

    # TODO: cruft?
    # def test_to_sql_save_index(self):
    #     self._to_sql_save_index()

    #     for ix_name, ix_col in zip(ixs.Key_name, ixs.Column_name):
    #         if ix_name not in ix_cols:
    #             ix_cols[ix_name] = []
    #         ix_cols[ix_name].append(ix_col)
    #     return ix_cols.values()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号