

def test_insert_select_partitioned_table(self):
    pytest.skip('IMPALA-2750')
    df = self.df
    unpart_t = self.db.table(self.pd_name)
    part_keys = ['year', 'month']
    part_t = self._create_partitioned_table(unpart_t.schema(), part_keys)
    unique_keys = df[part_keys].drop_duplicates()
    for (i, (year, month)) in enumerate(unique_keys.itertuples(index=False)):
        select_stmt = unpart_t[((unpart_t.year == year) & (unpart_t.month == month))]
        if i:
            part = {
                'year': year,
                'month': month,
            }
        else:
            part = [year, month]
        part_t.insert(select_stmt, partition=part)
    self._verify_partitioned_table(part_t, df, unique_keys)

dataset/ETHPy150Open cloudera/ibis/ibis/impala/tests/test_partition.py TestPartitioning.test_insert_select_partitioned_table/original