Skip to content

Refactor: Collapse nested if statements into single conditions - #4377

Merged
Fokko merged 1 commit into
apache:mainfrom
prabhleen2317:collapse-nested-if
Nov 14, 2026
Merged

Fokko merged 1 commit into
apache:mainfrom
prabhleen2317:collapse-nested-if

Conversation

@prabhleen2317

Copy link
Copy Markdown
Contributor

Summary

  • Merge nested if a: if b: blocks into if a and b: across four files
  • No behavior change — and short-circuits identically to a nested guard
  • Improves readability and reduces indentation depth

Files changed

  • pyiceberg/io/__init__.py
  • pyiceberg/partitioning.py
  • pyiceberg/table/metadata.py
  • pyiceberg/table/sorting.py

Merge nested `if a: if b:` blocks into `if a and b:` where the outer
branch does nothing but guard the inner one. `and` short-circuits
identically, so behavior is unchanged; this improves
indentation.
@prabhleen2317

Copy link
Copy Markdown
Contributor Author

Hello @Fokko and @rambleraptor please review the changes which I have done.

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

Thanks @prabhleen2317! Verified there are no behavioral changes, all checks green. LGTM! 🚀

@Fokko
Fokko added this pull request to the merge queue Nov 14, 2026
Merged via the queue into apache:main with commit 5436520 Nov 14, 2026
20 checks passed
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