Skip to content

feat(dataset)!: expose manifest_size on Version - #9102

Open
hiltonhe wants to merge 2 commits into
lance-format:mainfrom
hiltonhe:cg-manifest/02-version-manifest-size
Open

hiltonhe wants to merge 2 commits into
lance-format:mainfrom
hiltonhe:cg-manifest/02-version-manifest-size

Conversation

@hiltonhe

@hiltonhe hiltonhe commented Sep 9, 2026

Copy link
Copy Markdown

Dataset::versions() already knows each manifest's on-disk size from ManifestLocation but drops it. Keep it on the Version struct (and expose it in the Python versions() dicts) so metadata growth per version is queryable:

ds.versions()[-1]['manifest_size']

This is pure bookkeeping - no format change. The field is Option since manifest listing may not always provide a size (it is #[serde(default)] for backward-compatible deserialization).

Motivation: on wide tables the full manifest is rewritten on every commit; being able to chart manifest_size across versions is the cheapest way to quantify metadata amplification.

Dataset::versions() already knows each manifest's on-disk size from
ManifestLocation but drops it. Keep it on the Version struct (and expose
it in the Python versions() dicts) so metadata growth per version is
queryable:

    ds.versions()[-1]['manifest_size']

This is pure bookkeeping - no format change. The field is Option since
manifest listing may not always provide a size (it is #[serde(default)]
for backward-compatible deserialization).

Motivation: on wide tables the full manifest is rewritten on every
commit; being able to chart manifest_size across versions is the
cheapest way to quantify metadata amplification.
@github-actions github-actions Bot added A-python Python bindings enhancement New feature or request labels Sep 9, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Sep 9, 2026
Addresses the two review requests on lance-format#9102:

1. Add `manifest_size: int | None` to the public `Version` TypedDict in
   `python/python/lance/dataset.py`. The binding already returns the key, but
   typed callers could not use it: Pyright reported
   "manifest_size" is not a defined key in "Version". The field is optional
   because `ManifestLocation::size` is `Option<u64>` and is documented as
   possibly unknown. Also documents the returned fields on `versions()`.

2. Extend `test_versions` to assert the returned `manifest_size` against the
   corresponding `_versions/*.manifest` file size, so both the Rust
   propagation and the binding key are pinned. Resolving the file needs to
   handle V1 (`{version}.manifest`), V2 (`{u64::MAX - version:020}.manifest`)
   and detached (`d{version}.manifest`) naming.
@hiltonhe hiltonhe changed the title feat(dataset): expose manifest_size on Version feat(dataset)!: expose manifest_size on Version Sep 17, 2026
@lance-gatekeeper lance-gatekeeper Bot added K-changes Latest Gatekeeper recommendation requests changes. and removed K-changes Latest Gatekeeper recommendation requests changes. labels Sep 17, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The public Python type contract and regression coverage now match the implementation. The change remains small and reuses manifest metadata already returned by the commit handler, preserving an unknown size as None.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings breaking-change enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant