Skip to content

Commit

Permalink
Update dependency mypy to v1.13.0 (#10028)
Browse files Browse the repository at this point in the history
* Update dependency mypy to v1.13.0

* Fix mypy type error

* new variable for better typehint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Drini Cami <[email protected]>
Co-authored-by: RayBB <[email protected]>
  • Loading branch information
3 people authored Nov 14, 2024
1 parent 474bdca commit 8925624
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions openlibrary/core/lending.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,11 @@ def get_ocaid(item: dict) -> str | None:
possible_fields.remove('ia')
possible_fields.append('ia')

ocaids = []
ocaids: list[str] = []
for field in possible_fields:
if item.get(field):
ocaids += item[field] if isinstance(item[field], list) else [item[field]]
val = cast(list[str] | str, item[field])
ocaids += val if isinstance(val, list) else [val]
ocaids = uniq(ocaids)
return next((ocaid for ocaid in ocaids if not is_non_ia_ocaid(ocaid)), None)

Expand Down
4 changes: 2 additions & 2 deletions openlibrary/core/vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ def _get_betterworldbooks_metadata(isbn: str) -> dict | None:
price = _price
qlt = 'new'

market_price = ('$' + market_price[0]) if market_price else None
return betterworldbooks_fmt(isbn, qlt, price, market_price)
first_market_price = ('$' + market_price[0]) if market_price else None
return betterworldbooks_fmt(isbn, qlt, price, first_market_price)


def betterworldbooks_fmt(
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

-r requirements.txt
debugpy>=1.6.4
mypy==1.11.2
mypy==1.13.0
pymemcache==4.0.0
pytest==8.3.3
pytest-asyncio==0.24.0
Expand Down

0 comments on commit 8925624

Please sign in to comment.