Repository navigation
Conversation
When a field already has a RoiMask, _add_field_roi_masks fetched the main entry and re-inserted it with skip_duplicates=True. In DataJoint 2 a fetched <filepath> is an ObjectRef, which fails insert validation (TypeError: <filepath> expects a path string or Path, got ObjectRef), so new presentations of existing fields (e.g. a newly added stimulus) could not be added. - Only insert the main entry for new fields - Convert the fetched roi_mask_file back to a store-relative path, as it is also used for presentations filled via auto_fill_pres_keys - Add an integration regression test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RoiMask().rescan_filesystem(only_new_fields=False)crashed on any field that already has a RoiMask, so presentations added to existing fields later (for example a newly registered stimulus) could not get ROI masks. Cause: the existing main entry was fetched and re-inserted. In DataJoint 2 a fetched<filepath>is anObjectRef, which fails insert validation beforeskip_duplicatesapplies._add_field_roi_masks(field_key) if field has no RoiMask pick main mask from files else fetch main mask, roi_mask_file, roi_mask_source + roi_mask_file = relative_store_path(local_file_path(roi_mask_file)) # ObjectRef -> str build RoiMaskPresentation rows (auto_fill rows reuse main roi_mask_file) - insert1(main_key, skip_duplicates=True) + if field had no RoiMask + insert1(main_key, skip_duplicates=True) insert RoiMaskPresentation rowsEvidence
Before: real project schema, 11 new FlashesBGW presentations on 11 existing fields:
After: same call adds the 11
RoiMaskPresentationrows (allas_field_mask='same'). TheRoiMaskcount stays at 32, and Traces/Snippets populate for the new presentations.New integration test
_check_rescan_adds_presentations_to_existing_field(intest_tutorial_pipeline):It fails with the TypeError above without the fix. It runs in the MySQL integration workflow, which was not run locally (no MySQL test server). Unit tests pass locally (288 passed, 32 skipped).
Merge Danger
Door: two-way
Blast Radius: small
Only affects
rescan_filesystemfor fields that already have a RoiMask, which previously always raised. New fields go through the unchanged path.🤖 Generated with Claude Code