Skip to content

Make View.version return None for unknown id#3445

Merged
Fokko merged 1 commit into
apache:mainfrom
ebyhr:ebi/view-version
Jun 5, 2026
Merged

Make View.version return None for unknown id#3445
Fokko merged 1 commit into
apache:mainfrom
ebyhr:ebi/view-version

Conversation

@ebyhr
Copy link
Copy Markdown
Member

@ebyhr ebyhr commented May 30, 2026

Rationale for this change

Follow-up of #3338
It would be preferable to return None instead of throwing StopIteration.

Iceberg Java returns null if the specified version doesn't exist:

https://github.com/apache/iceberg/blob/6a737004506176a902784ec30fc4d545c1ce6997/api/src/main/java/org/apache/iceberg/view/View.java#L60-L66

@return a version, or null if the ID cannot be found

Are these changes tested?

Yes

Are there any user-facing changes?

No, the method isn't released yet.

@ebyhr ebyhr changed the title Make View.version return None for unknown version Make View.version return None for unknown id May 31, 2026
Copy link
Copy Markdown
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

I agree this is cleaner, thanks @ebyhr for the follow up here

@Fokko Fokko merged commit 0695f07 into apache:main Jun 5, 2026
16 checks passed
@ebyhr ebyhr deleted the ebi/view-version branch June 5, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants