Skip to content

Commit

Permalink
style: add typing
Browse files Browse the repository at this point in the history
  • Loading branch information
alimghmi committed Oct 29, 2023
1 parent 437559c commit 1c6356a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scraper/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class Engine:
def __init__(self, url, max_retries, backoff_factor) -> None:
def __init__(self, url: str, max_retries: int, backoff_factor: int) -> None:
self.url = url
self.request = Request(max_retries=max_retries, backoff_factor=backoff_factor)

Expand All @@ -28,7 +28,7 @@ def fetch(self, content: str = None) -> pd.DataFrame:
logger.info(f"Parsed content from {self.url}. Extracted {len(df)} rows.")
return df

def get_content(self):
def get_content(self) -> str:
try:
r = self.request.request("GET", self.url)
r.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion utils/request_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class Request:
def __init__(self, max_retries, backoff_factor) -> None:
def __init__(self, max_retries: int, backoff_factor: int) -> None:
self.max_retries = max_retries
self.backoff_factor = backoff_factor

Expand Down

0 comments on commit 1c6356a

Please sign in to comment.