Open
Conversation
src/vorta/storesrc/vorta/store for typesafety
Collaborator
real-yfprojects
left a comment
There was a problem hiding this comment.
Good progress. Typing is hard but valuable!
| # The last `create` command of each profile must not be deleted | ||
| # since the scheduler uses it to determine the last backup time. | ||
| last_backups_per_profile = ( | ||
| last_backups_per_profile = Tuple( |
Collaborator
There was a problem hiding this comment.
I don't think this is proper use of type hints. Shouldn't it be the following instead?
Suggested change
| last_backups_per_profile = Tuple( | |
| last_backups_per_profile : Tuple = |
Collaborator
Author
There was a problem hiding this comment.
last_scheduled_backups_per_profile just a bit below (line 71) was assigned like that ( = Tuple(...)) so, I did it to last_backups_per_profile for consistency. I think it would be better to do it according to your suggestion or keep both like:
last_backups_per_profile: Tuple = Tuple(
src/vorta/store/migrations.py
Outdated
|
|
||
|
|
||
| def run_migrations(current_schema, db_connection): | ||
| def run_migrations(current_schema: Any, db_connection: SqliteDatabase): |
Collaborator
There was a problem hiding this comment.
Do we have to specify Any? Isn't it the default, implicit type hint?
Collaborator
Author
There was a problem hiding this comment.
I think I left that one undone. It should be SchemVersion from vorta.store.models
src/vorta/store for typesafetysrc/vorta/store
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.
Description
To improve readability a bit, and towards making the codebase typesafe.
Related Issue
#1870
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.