Skip to content

Retrieving pickle dtype to avoid sqlgraph mask update error#200

Merged
JoOkuma merged 1 commit intoroyerlab:mainfrom
yfukai:fix_sqlgraph_attr
Nov 17, 2025
Merged

Retrieving pickle dtype to avoid sqlgraph mask update error#200
JoOkuma merged 1 commit intoroyerlab:mainfrom
yfukai:fix_sqlgraph_attr

Conversation

@yfukai
Copy link
Copy Markdown
Contributor

@yfukai yfukai commented Nov 14, 2025

This pull request addresses the handling of pickled column types in SQL-based graph backends, ensuring that columns storing pickled Python objects (such as custom masks) are correctly restored after reloading from disk. The changes also add a test to verify this behavior.

Persistence and restoration of pickled column types:

  • Added the _restore_pickled_column_types method to the Metadata class, which scans table columns and restores any LargeBinary columns to use PickleType upon table loading. This ensures that custom Python objects remain deserializable after database reloads.
  • Updated the table loading logic in the Base class to invoke _restore_pickled_column_types for each table when not overwriting, so column types are restored before ORM class creation.

Testing improvements:

  • Added the test_sql_graph_mask_update_survives_reload test to ensure that a pickled Mask object can be updated and retrieved correctly after reloading the SQL database, verifying the persistence fix.

@yfukai yfukai marked this pull request as ready for review November 14, 2025 08:59
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.24%. Comparing base (5d110f2) to head (59d6db2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   88.00%   88.24%   +0.23%     
==========================================
  Files          51       51              
  Lines        3686     3692       +6     
  Branches      638      641       +3     
==========================================
+ Hits         3244     3258      +14     
+ Misses        267      261       -6     
+ Partials      175      173       -2     

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

Copy link
Copy Markdown
Member

@JoOkuma JoOkuma left a comment

Choose a reason for hiding this comment

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

LGTM!

@JoOkuma JoOkuma merged commit 2bf5cb1 into royerlab:main Nov 17, 2025
6 of 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.

3 participants