Skip to content

maintenance

MaintenanceTable

Source code in pyiceberg/table/maintenance.py
class MaintenanceTable:
    tbl: Table

    def __init__(self, tbl: Table) -> None:
        self.tbl = tbl

    def expire_snapshots(self) -> ExpireSnapshots:
        """Return an ExpireSnapshots builder for snapshot expiration operations.

        Returns:
            ExpireSnapshots builder for configuring and executing snapshot expiration.
        """
        from pyiceberg.table import Transaction
        from pyiceberg.table.update.snapshot import ExpireSnapshots

        return ExpireSnapshots(transaction=Transaction(self.tbl, autocommit=True))

expire_snapshots()

Return an ExpireSnapshots builder for snapshot expiration operations.

Returns:

Type Description
ExpireSnapshots

ExpireSnapshots builder for configuring and executing snapshot expiration.

Source code in pyiceberg/table/maintenance.py
def expire_snapshots(self) -> ExpireSnapshots:
    """Return an ExpireSnapshots builder for snapshot expiration operations.

    Returns:
        ExpireSnapshots builder for configuring and executing snapshot expiration.
    """
    from pyiceberg.table import Transaction
    from pyiceberg.table.update.snapshot import ExpireSnapshots

    return ExpireSnapshots(transaction=Transaction(self.tbl, autocommit=True))