-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit improves `migrate()` by removing bugs, making it more readable, adding argument validations, etc. However, it doesn't change the migration of metadata instances this function currently intend to implement, per my best guess. The following are descriptions of the more prominent improvements: 1. Correct the type annotation of `to_version` (Bug fix) 2. Validate that the provided metadata instance and the target version specifies valid DANDI schema versions 3. Ensure the optional validation of the provided instance against its specified schema is done before any migration operation, to achieve greater consistency. 4. Return the instance unchanged when DANDI schema version of the given instance is equal to the target version instead (Bug fix). 5. Consistently use the tuple representations of DANDI schema versions to route the execution flow of migration operations to ensure all cases of the relation between the schema version of the instance and target version are covered. 6. Condition the migration to "0.6.0" and beyond on the target version being at least "0.6.0". (Bug fix) 7. Copy input instance for migration only immediately before migration operations 7. Rename local variables to improve readability 8. Handle the situation in which the input metadata instance not having the "assetsSummary" field Co-authored-by: Yaroslav Halchenko <[email protected]> Co-authored-by: John T. Wodder II <[email protected]>
- Loading branch information
1 parent
6fd04fb
commit 89e2cb7
Showing
2 changed files
with
160 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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