From 81d6ad906cdf49b1a0e1df12553a36c0309a2286 Mon Sep 17 00:00:00 2001 From: Andre Wohnsland <50302161+AndreWohnsland@users.noreply.github.com> Date: Sat, 1 Jun 2024 09:53:30 +0200 Subject: [PATCH] Use default factory for empty df --- src/datastore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datastore.py b/src/datastore.py index 52ae65a..d0b8c05 100644 --- a/src/datastore.py +++ b/src/datastore.py @@ -11,7 +11,7 @@ @dataclass class Store: - df: pd.DataFrame = pd.DataFrame() + df: pd.DataFrame = field(default_factory=pd.DataFrame) daily_data: list[tuple[str, str]] = field(default_factory=list) current_date: datetime.date = datetime.date.today() # dict with key: (year, month) and value: (hash(raw_data), pd.DataFrame)