Skip to content

Commit

Permalink
black chess
Browse files Browse the repository at this point in the history
  • Loading branch information
AstrakhantsevaAA committed Feb 5, 2024
1 parent d1f2c3e commit 383cb33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sources/chess/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""A source loading player profiles and games from chess.com api"""

from typing import Callable, Iterator, List, Sequence, Dict, Any
from typing import Any, Callable, Dict, Iterator, List, Sequence

import dlt
from dlt.common import pendulum
from dlt.common.typing import TDataItem
from dlt.sources import DltResource
from dlt.sources.helpers import requests
from .helpers import get_url_with_retry, get_path_with_retry, validate_month_string

from .helpers import get_path_with_retry, get_url_with_retry, validate_month_string
from .settings import UNOFFICIAL_CHESS_API_URL


Expand Down Expand Up @@ -137,9 +137,7 @@ def players_online_status(players: List[str]) -> Iterator[TDataItem]:
"""
# we'll use unofficial endpoint to get online status, the official seems to be removed
for player in players:
status = get_url_with_retry(
f"{UNOFFICIAL_CHESS_API_URL}user/popup/{player}"
)
status = get_url_with_retry(f"{UNOFFICIAL_CHESS_API_URL}user/popup/{player}")
# return just relevant selection
yield {
"username": player,
Expand Down
1 change: 1 addition & 0 deletions sources/chess/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from dlt.common.typing import StrAny
from dlt.sources.helpers import requests

from .settings import OFFICIAL_CHESS_API_URL


Expand Down

0 comments on commit 383cb33

Please sign in to comment.