Skip to content

Core: Preserve null operations in inspect.snapshots - #3707

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/inspect-snapshots-null-operation
Open

Core: Preserve null operations in inspect.snapshots#3707
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/inspect-snapshots-null-operation

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

The snapshots metadata table declares operation as nullable because snapshots without a summary do not have an operation. However, InspectTable.snapshots() converted the missing value with str(None), returning the literal string "None" instead of null.

This change passes the operation directly to PyArrow, preserving null semantics and matching Apache Iceberg Java's snapshots metadata table.

Are these changes tested?

Yes. A regression test creates a snapshot without a summary and verifies that table.inspect.snapshots() returns a null operation.

The following checks pass locally:

  • PYTHONPATH=. uv run pytest tests/table/test_inspect.py -q (5 passed)
  • PYTHONPATH=. uv run --extra datafusion --extra pyiceberg-core pytest tests/table -q (328 passed)
  • make lint

Are there any user-facing changes?

Yes. For snapshots without a summary, table.inspect.snapshots() now returns null in the operation column instead of the string "None". There are no API changes.

Comment thread tests/table/test_inspect.py Outdated
Comment thread tests/table/test_inspect.py Outdated
@fallintoplace
fallintoplace force-pushed the fix/inspect-snapshots-null-operation branch from 6ffcda5 to 786fd6f Compare July 31, 2026 10:32
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Aug 31, 2026

@Fokko Fokko 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.

Reasonable change, thanks @fallintoplace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants