(self, parent_table, retention_period, partition_period)
return res
Drop obsolete partitions of partition-by-date parent table.
Drop obsolete partitions of partition-by-date parent table.
Drop obsolete partitions of partition - by - date parent table .
def drop_obsolete_partitions (self, parent_table, retention_period, partition_period):
        """ Drop obsolete partitions of partition-by-date parent table.
        """
        curs = self.dst_curs
        func = RETENTION_FUNC
        args = [parent_table, retention_period, partition_period]
        sql = "select " + func + " (%s, %s, %s)"
        self.log.debug("func: %s, args: %s", func, args)
        curs.execute(sql, args)
        res = [row[0] for row in curs.fetchall()]
        if res:
            self.log.info("Dropped tables: %s", ", ".join(res))
        return res
def drop_obsolete_partitions ( self , parent_table , retention_period , partition_period ) : curs = self . dst_curs func = RETENTION_FUNC args = [ parent_table , retention_period , partition_period ] sql = "select " + func + " (%s, %s, %s)" self . log . debug ( "func: %s, args: %s" , func , args ) curs . execute ( sql , args ) res = [ row [ 0 ] for row in curs . fetchall ( ) ] if res : self . log . info ( "Dropped tables: %s" , ", " . join ( res ) ) return res