Skip to content

Home / reference / snapshots

icechunk.snapshots#

Snapshot metadata: diffs, snapshot info, and manifest file info.

icechunk.snapshots #

Classes:

Name Description
AncestryGraph

A visual representation of commit history.

Diff

The result of comparing two snapshots

ManifestFileInfo

Manifest file metadata

SnapshotInfo

Metadata for a snapshot

AncestryGraph #

A visual representation of commit history.

Use print() for colored Unicode output in a terminal, or display in Jupyter for an SVG diagram. Pass plain=True to ancestry_graph() for output without colors (useful for CI, files, or LLM agents).

Note: only commits reachable from branches are included. Anonymous/detached snapshots are not attached to any branch and will not appear.

Source code in icechunk-python/python/icechunk/_icechunk_python.pyi
@final
class AncestryGraph:
    """A visual representation of commit history.

    Use ``print()`` for colored Unicode output in a terminal, or display
    in Jupyter for an SVG diagram. Pass ``plain=True`` to
    ``ancestry_graph()`` for output without colors (useful for CI, files,
    or LLM agents).

    Note: only commits reachable from branches are included. Anonymous/detached
    snapshots are not attached to any branch and will not appear.
    """
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    def _repr_svg_(self) -> str:
        """Return a raw SVG string for Jupyter notebooks."""
        ...

Diff #

The result of comparing two snapshots

Methods:

Name Description
is_empty

Returns True if the diff contains no changes.

Attributes:

Name Type Description
deleted_arrays set[str]

The arrays that were deleted in the target ref.

deleted_groups set[str]

The groups that were deleted in the target ref.

moved_nodes list[tuple[str, str]]

The list of node moves, in order of application, as tuples (from_path, to_path).

new_arrays set[str]

The arrays that were added to the target ref.

new_groups set[str]

The groups that were added to the target ref.

updated_arrays set[str]

The arrays that were updated via zarr metadata in the target ref.

updated_chunks dict[str, list[list[int]]]

The chunks indices that had data updated in the target ref, keyed by the path to the array.

updated_groups set[str]

The groups that were updated via zarr metadata in the target ref.

Source code in icechunk-python/python/icechunk/_icechunk_python.pyi
class Diff:
    """The result of comparing two snapshots"""
    def is_empty(self) -> bool:
        """
        Returns True if the diff contains no changes.
        """
        ...
    @property
    def new_groups(self) -> set[str]:
        """
        The groups that were added to the target ref.
        """
        ...
    @property
    def new_arrays(self) -> set[str]:
        """
        The arrays that were added to the target ref.
        """
        ...
    @property
    def deleted_groups(self) -> set[str]:
        """
        The groups that were deleted in the target ref.
        """
        ...
    @property
    def deleted_arrays(self) -> set[str]:
        """
        The arrays that were deleted in the target ref.
        """
        ...
    @property
    def updated_groups(self) -> set[str]:
        """
        The groups that were updated via zarr metadata in the target ref.
        """
        ...
    @property
    def updated_arrays(self) -> set[str]:
        """
        The arrays that were updated via zarr metadata in the target ref.
        """
        ...
    @property
    def updated_chunks(self) -> dict[str, list[list[int]]]:
        """
        The chunks indices that had data updated in the target ref, keyed by the path to the array.
        """
        ...
    @property
    def moved_nodes(self) -> list[tuple[str, str]]:
        """
        The list of node moves, in order of application, as tuples (from_path, to_path).
        """
        ...
    def __repr__(self) -> str: ...
    def __str__(self) -> str: ...
    def _repr_html_(self) -> str: ...

deleted_arrays property #

deleted_arrays

The arrays that were deleted in the target ref.

deleted_groups property #

deleted_groups

The groups that were deleted in the target ref.

moved_nodes property #

moved_nodes

The list of node moves, in order of application, as tuples (from_path, to_path).

new_arrays property #

new_arrays

The arrays that were added to the target ref.

new_groups property #

new_groups

The groups that were added to the target ref.

updated_arrays property #

updated_arrays

The arrays that were updated via zarr metadata in the target ref.

updated_chunks property #

updated_chunks

The chunks indices that had data updated in the target ref, keyed by the path to the array.

updated_groups property #

updated_groups

The groups that were updated via zarr metadata in the target ref.

is_empty #

is_empty()

Returns True if the diff contains no changes.

Source code in icechunk-python/python/icechunk/_icechunk_python.pyi
def is_empty(self) -> bool:
    """
    Returns True if the diff contains no changes.
    """
    ...

ManifestFileInfo #

Manifest file metadata

Attributes:

Name Type Description
id str

The manifest id

num_chunk_refs int

The number of chunk references contained in this manifest

size_bytes int

The size in bytes of the

Source code in icechunk-python/python/icechunk/_icechunk_python.pyi
class ManifestFileInfo:
    """Manifest file metadata"""

    def __repr__(self, /) -> str: ...
    def __str__(self, /) -> str: ...
    def _repr_html_(self, /) -> str: ...
    @property
    def id(self) -> str:
        """The manifest id"""
        ...
    @property
    def size_bytes(self) -> int:
        """The size in bytes of the"""
        ...
    @property
    def num_chunk_refs(self) -> int:
        """The number of chunk references contained in this manifest"""
        ...

id property #

id

The manifest id

num_chunk_refs property #

num_chunk_refs

The number of chunk references contained in this manifest

size_bytes property #

size_bytes

The size in bytes of the

SnapshotInfo #

Metadata for a snapshot

Attributes:

Name Type Description
id str

The snapshot ID

message str

The commit message of the snapshot

metadata dict[str, Any]

The metadata of the snapshot

parent_id str | None

The snapshot ID

written_at datetime

The timestamp when the snapshot was written

Source code in icechunk-python/python/icechunk/_icechunk_python.pyi
class SnapshotInfo:
    """Metadata for a snapshot"""
    @property
    def id(self) -> str:
        """The snapshot ID"""
        ...
    @property
    def parent_id(self) -> str | None:
        """The snapshot ID"""
        ...
    @property
    def written_at(self) -> datetime.datetime:
        """
        The timestamp when the snapshot was written
        """
        ...
    @property
    def message(self) -> str:
        """
        The commit message of the snapshot
        """
        ...
    @property
    def metadata(self) -> dict[str, Any]:
        """
        The metadata of the snapshot
        """
        ...
    def __repr__(self) -> str: ...
    def __str__(self) -> str: ...
    def _repr_html_(self) -> str: ...

id property #

id

The snapshot ID

message property #

message

The commit message of the snapshot

metadata property #

metadata

The metadata of the snapshot

parent_id property #

parent_id

The snapshot ID

written_at property #

written_at

The timestamp when the snapshot was written