Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hint commands modules #212

Merged
merged 6 commits into from
Jan 31, 2025
Merged

Type hint commands modules #212

merged 6 commits into from
Jan 31, 2025

Conversation

Jakob37
Copy link
Collaborator

@Jakob37 Jakob37 commented Jan 31, 2025

Type hinting started for command and db modules.

Will need testing after updating to 3.12, as it currently uses syntax not supported by 3.8.

The parts touching on Mongo are tricky to get typed correctly. Hopefully #191 will help, at least in part.

Not sure it will resolve the MongoClient instance typings, which seems to expect a subtype for the generics. Maybe a bit more googling will help.

Review:

  • code approved by

@Jakob37 Jakob37 marked this pull request as draft January 31, 2025 07:54
@Jakob37 Jakob37 marked this pull request as ready for review January 31, 2025 10:22
@Jakob37 Jakob37 requested a review from mhkc January 31, 2025 10:25
Copy link
Collaborator

@mhkc mhkc left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -17,7 +18,7 @@
UPDATES = "updates"


def register_data_update(track_type, name=None):
def register_data_update(track_type: str, name: Optional[str]=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional[str] kan också skrivas som str | None. Kanske är tydligare?

@Jakob37 Jakob37 merged commit a37cc65 into master Jan 31, 2025
3 of 5 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.

2 participants