Skip to content

Commit

Permalink
Merge pull request #27 from doriath/types
Browse files Browse the repository at this point in the history
Small fixes to typing information.
  • Loading branch information
xuhcc authored Mar 17, 2021
2 parents f993ac4 + a094291 commit d2f292f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beanprice/sources/yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from datetime import datetime, timedelta, timezone
from decimal import Decimal
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Optional, Tuple, Union

import requests

Expand Down Expand Up @@ -55,7 +55,7 @@ def parse_response(response: requests.models.Response) -> Dict:
}


def parse_currency(result: Dict[str, Any]) -> str:
def parse_currency(result: Dict[str, Any]) -> Optional[str]:
"""Infer the currency from the result."""
if 'market' not in result:
return None
Expand All @@ -77,7 +77,7 @@ def get_price_series(ticker: str,
if requests is None:
raise YahooError("You must install the 'requests' library.")
url = "https://query1.finance.yahoo.com/v8/finance/chart/{}".format(ticker)
payload = {
payload: Dict[str, Union[int, str]] = {
'period1': int(time_begin.timestamp()),
'period2': int(time_end.timestamp()),
'interval': '1d',
Expand Down

0 comments on commit d2f292f

Please sign in to comment.