Skip to content

Commit

Permalink
refactor: reorder params
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed Aug 8, 2024
1 parent b85c633 commit 7556ce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x_notes/tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .exceptions import DataNotFoundException


def get_generator(date: datetime.date, fname: str, index: int = 0) -> Generator:
def get_generator(fname: str, date: datetime.date, index: int = 0) -> Generator:
url_tmpl = (
f"https://ton.twimg.com/birdwatch-public-data/{{date}}/{fname}-{index:05d}.tsv"
)
Expand All @@ -34,7 +34,7 @@ def get_todays_data(fname: str, index: int = 0) -> Generator:
for n in range(num_days_ago_to_try + 1):
try:
n_days_ago = today - datetime.timedelta(days=n)
return get_generator(n_days_ago, fname, index)
return get_generator(fname, n_days_ago, index)
except Exception:
pass
raise DataNotFoundException

0 comments on commit 7556ce9

Please sign in to comment.