Skip to content

fix: hydrate relation role-player references by IID#128

Closed
ds1sqe wants to merge 1 commit into
masterfrom
bug-126
Closed

fix: hydrate relation role-player references by IID#128
ds1sqe wants to merge 1 commit into
masterfrom
bug-126

Conversation

@ds1sqe
Copy link
Copy Markdown
Owner

@ds1sqe ds1sqe commented May 21, 2026

Fix relation-as-role-player hydration when TypeDB fetch results include only the nested relation IID/type metadata.

These relation references are now built as partial IID-backed instances instead of going through normal constructor validation, which avoids requiring the nested relation's own role players.

Also prevent omitted optional roles from retaining class-level RoleRef defaults on relation instances.

Closes: #126

Fix relation-as-role-player hydration when TypeDB fetch results include
only the nested relation IID/type metadata.

These relation references are now built as partial IID-backed instances
instead of going through normal constructor validation, which avoids
requiring the nested relation's own role players.

Also prevent omitted optional roles from retaining class-level `RoleRef`
defaults on relation instances.

Closes: #126
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 57.62712% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
type_bridge/models/relation.py 70.83% 4 Missing and 3 partials ⚠️
type_bridge/typedb_driver.py 22.22% 7 Missing ⚠️
type_bridge/models/role.py 45.45% 6 Missing ⚠️
type_bridge/crud/role_players.py 63.63% 2 Missing and 2 partials ⚠️
type_bridge/session.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ds1sqe ds1sqe closed this May 21, 2026
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.

BUG: RoleRef leak on unset optional role

1 participant