From 7556ce92df75aa0c5aec5b331d5c76a63cb6143b Mon Sep 17 00:00:00 2001 From: Andy Lulham Date: Thu, 8 Aug 2024 13:44:10 +0100 Subject: [PATCH] refactor: reorder params --- x_notes/tsv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x_notes/tsv.py b/x_notes/tsv.py index 85c3a424..b7d50f0e 100644 --- a/x_notes/tsv.py +++ b/x_notes/tsv.py @@ -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" ) @@ -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