Skip to content

refactor(storage_format): split base Node class into two distinctclasses for leaf and internal nodes and updated the usage in serializer.py and tests. - #340

Merged
mattsva merged 1 commit into
danieldeer:db-enginefrom
mohammedFawzy0111:db-engine
Oct 12, 2026
Merged

mattsva merged 1 commit into
danieldeer:db-enginefrom
mohammedFawzy0111:db-engine

Conversation

@mohammedFawzy0111

@mohammedFawzy0111 mohammedFawzy0111 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

refactor the Node class to to seprate calsses for LeafNode and InternalNode instead of depending on a boolean.

Closes #339

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Key Changes

  • add LeafNode class.
  • add InternalNode class.
  • Remove Node class and replace it with a type alias to LeafNode and InternalNode.
  • refactor PageSerializer.serialize() to work with the new classes.
  • refactor PageSerializer.deserialize() to work with the new classes.
  • updated tests for the new classes and remove unnecessary tests.

Validation

  • all pre-commit hooks passed.
  • formated using ruff format .
  • ty check passed.

Checklist

  • I reviewed the diff and kept it focused on the described change.
  • Python changes pass uv run ruff check . and uv run ruff format --check ., or this PR does not change Python.
  • Changed behavior is covered by appropriate tests, including a regression test for bug fixes; any limitations are explained under Validation.
  • Validation lists the checks or manual flows I ran and their results.
  • Relevant documentation is updated, or no documentation change is needed.

classes for leaf and internal nodes and updated the usage in
serializer.py and tests.

@mattsva mattsva left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@mohammedFawzy0111 please tell @sowashieristjaschoninteressant in PR #338 what needs to be changed there to make it work.

@mattsva

mattsva commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Merging this.

@mattsva
mattsva merged commit 0233c1d into danieldeer:db-engine Oct 12, 2026
7 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