Skip to content

Conversation

@soininen
Copy link
Contributor

@soininen soininen commented Jan 13, 2026

Previously, the stacked tables showed extra items that were in direct relationship with the selected entity in the Entity tree. With this PR, also all relationship-of-relationship items are show in the tables.

Fixes #3242

Checklist before merging

  • Documentation is up-to-date
  • Release notes have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

…ships

Superclasses and relationships-of-relationships have existed
for quite some time already. Still, the stacked tables showed only the first
level of related relationships. This commit finally brings in the entire
relationship tree (accounting for superclasses, too) when considering what
to show in the tabular views.

To achieve this, DB manager now lazily chaches entity class and entity trees
as networkx Graphs. We treat superclassess as relationships of their subclasses
which works for the filtering purposes. The graphs allows us to easily track
if an entity (class) is an element (or part of an element) of a relationship,
no matter how deep the relationship tree is or how many superclasses there are
on the way.

Re #3242
Previously, when selecting entities or anything deeper than entity classes
in Entity tree, all the selected item's parent items were used for
filtering as well. This didn't work very well now that we show everything
concerning the selected entity including relationships-of-relationships
in the stacked tables. Instead, only the selected entities are used
for the filtering.

Re #3242
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.24%. Comparing base (f6d098c) to head (512059e).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
spinetoolbox/relationship_graphs.py 94.02% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3251      +/-   ##
==========================================
+ Coverage   70.21%   70.24%   +0.03%     
==========================================
  Files         204      205       +1     
  Lines       39222    39286      +64     
  Branches     4731     4744      +13     
==========================================
+ Hits        27539    27597      +58     
- Misses      10385    10388       +3     
- Partials     1298     1301       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@soininen soininen merged commit f8c0244 into master Jan 13, 2026
19 checks passed
@soininen soininen deleted the 3242_more_dependees_in_tables branch January 13, 2026 13:55
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.

Show related instances of super classes in tree

2 participants