Skip to content

Conversation

@MaximeBICMTL
Copy link
Contributor

@MaximeBICMTL MaximeBICMTL commented Dec 19, 2025

Builds on #1349

Description

Migrate the ORM models and queries from the str type for paths, to pathlib.Path, and consolidate the ORM around the path naming for paths (instead of path, rel_path, location...).

Testing

  • Ran the DICOM study importer manually and checked the result.
  • PR code is strictly typed and change is rather straightforward.

Detailed changes

Add a new StringPath decorator to translate back and forth between SQL strings and Python paths.

Renamings:

  • DbDicomArchive.source_location -> DbDicomArchive.source_path
  • DbDicomArchive.archive_location -> DbDicomArchive.archive_path
  • DbFile.rel_path -> DbFile.path
  • DbMriProtocolViolatedScan.file_rel_path -> DbMriProtocolViolatedScan.file_path
  • DbMriUpload.upload_location -> DbMriUpload.upload_path
  • DbMriUpload.decompressed_location -> DbMriUpload.decompressed_path
  • DbMriViolationLog.file_rel_path -> DbMriViolationLog.file_path

Type changes (from str to Path):

  • DbDicomArchive.source_path
  • DbDicomArchive.archive_path
  • DbFile.path
  • DbMriProtocolViolatedScan.file_path
  • DbMriUpload.upload_path
  • DbMriUpload.decompressed_path
  • DbMriViolationLog.file_path
  • DbPhysioChannel.file_path
  • DbPhysioCoordSystem.file_path
  • DbPhysioEventFile.file_path
  • DbPhysioFile.path

@MaximeBICMTL MaximeBICMTL added Caveat for Existing Projects Issue or PR that introduces or may introduce breaking changes for existing projects Category: Refactor Issue or PR that aims to improve the existing code Language: Python Issue or PR related to the Python codebase Area: ORM Issue or PR related to the SQLAlchemy integration Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test labels Dec 19, 2025
@MaximeBICMTL MaximeBICMTL force-pushed the migrate_orm_to_pathlib_path branch from 6f350e0 to b6989c4 Compare December 19, 2025 09:40
@MaximeBICMTL MaximeBICMTL changed the title Migrate ORM to pathlib.Path Migrate ORM to pathlib.Path (path PR 2) Dec 19, 2025
@MaximeBICMTL MaximeBICMTL force-pushed the migrate_orm_to_pathlib_path branch 5 times, most recently from a8ba5c4 to 937ca00 Compare December 19, 2025 10:33
@MaximeBICMTL MaximeBICMTL marked this pull request as ready for review December 19, 2025 10:41
Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

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

I proofread the Files changed and it LGTM!

@MaximeBICMTL MaximeBICMTL added this to the 28.0.0 milestone Dec 22, 2025
@MaximeBICMTL MaximeBICMTL changed the base branch from main to maxime_changes December 22, 2025 09:09
@MaximeBICMTL MaximeBICMTL force-pushed the migrate_orm_to_pathlib_path branch from 937ca00 to c190880 Compare December 22, 2025 09:10
@MaximeBICMTL MaximeBICMTL force-pushed the migrate_orm_to_pathlib_path branch from c190880 to def2184 Compare December 22, 2025 09:15
@MaximeBICMTL MaximeBICMTL merged commit 6ebbfab into aces:maxime_changes Dec 22, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: ORM Issue or PR related to the SQLAlchemy integration Category: Refactor Issue or PR that aims to improve the existing code Caveat for Existing Projects Issue or PR that introduces or may introduce breaking changes for existing projects Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test Language: Python Issue or PR related to the Python codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants