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 annotations and related changes for connectors #2925

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

jderuiter
Copy link
Contributor

Mostly type annotations, but a couple of changes to the code to handle potential undefined or None values. Probably wouldn't hurt if someone a bit more familiar with the code would go over it to see whether it makes sense like this.

The create_edition_from_data method seems a bit funny as it expects different arguments in the inventaire connector compared to its parent AbstractConnector, which results in a Union type.

Copy link
Member

@mouse-reeve mouse-reeve 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 to me, thank you so much for digging into what is one of the gnarlier parts of the codebase

self.search_url = info.search_url
self.isbn_search_url = info.isbn_search_url
self.name = info.name
self.identifier = info.identifier
Copy link
Member

Choose a reason for hiding this comment

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

this is much simpler, thanks for fixing

@mouse-reeve mouse-reeve merged commit acafa0b into bookwyrm-social:main Aug 2, 2023
10 checks passed
@jderuiter jderuiter deleted the mypy-connectors branch August 25, 2023 08:32
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