Skip to content

Add types to vendors.py#11433

Open
cdrini wants to merge 2 commits intointernetarchive:masterfrom
cdrini:refactor/add-types-vendors
Open

Add types to vendors.py#11433
cdrini wants to merge 2 commits intointernetarchive:masterfrom
cdrini:refactor/add-types-vendors

Conversation

@cdrini
Copy link
Collaborator

@cdrini cdrini commented Nov 7, 2025

Small addendum to #11379 , adding type hints to vendors.py

Technical

Testing

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings November 7, 2025 14:10
@cdrini cdrini added the Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed] label Nov 7, 2025
}


cached_get_betterworldbooks_metadata = cache.memcache_memoize(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This looks a bit odd, but I couldn't find any use of this function... CC @mekarpeles

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds type hints to the vendors.py file by introducing TypedDict classes for Better World Books metadata structures and updating function signatures with proper return types.

Key changes:

  • Defines BetterWorldBooksMetadata and BetterWorldBooksMetadataError TypedDict classes for structured typing
  • Updates return type annotations for Better World Books-related functions to use the new TypedDict types
  • Removes the cached version of get_betterworldbooks_metadata function
Comments suppressed due to low confidence (1)

openlibrary/core/vendors.py:1

  • The removal of cached_get_betterworldbooks_metadata may break code that depends on this cached function. This appears to be an unintended deletion rather than a refactoring, as no replacement is provided and the PR description doesn't mention removing caching functionality.
from __future__ import annotations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation bot moved this to Waiting Review/Merge from Staff in Ray's Project Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]

Projects

Status: Waiting Review/Merge from Staff

Development

Successfully merging this pull request may close these issues.

2 participants