From 6bc79d46de36fb8557811f0dc13254df052d29c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bosse=20Nystr=C3=B6m?= Date: Fri, 28 Apr 2023 13:45:32 +0200 Subject: [PATCH 1/2] uses a join to remove a warning --- routes/tempo_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/tempo_data.py b/routes/tempo_data.py index 21d6fac..481eaeb 100644 --- a/routes/tempo_data.py +++ b/routes/tempo_data.py @@ -38,7 +38,8 @@ def load(self, from_date: str = "1970-01-01", to_date: str = str(date.today())) self.data = self.raw[["issue.key", "timeSpentSeconds", "billableSeconds", "startDate", "author.displayName"]] self.data.columns = ["Key", "Time", "Billable", "Date", "User"] df = pd.DataFrame(self.data.loc[:, ("Key")].str.split("-", n=1).tolist(), columns=["Group", "Number"]) - self.data.loc[:, ("Group")] = df["Group"] + self.data = self.data.join(df) + self.data = self.data.drop(["Number"], axis="columns") self.data.loc[:, ("Date")] = pd.to_datetime(self.data.loc[:, ("Date")], format="%Y-%m-%d") self.data.loc[:, ("Time")] = self.data.loc[:, ("Time")] / 3600 self.data.loc[:, ("Billable")] = self.data.loc[:, ("Billable")] / 3600 From 2454e6ba5ee5e9f464552b7fd9746c090d61ac5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bosse=20Nystr=C3=B6m?= Date: Fri, 28 Apr 2023 14:00:22 +0200 Subject: [PATCH 2/2] replaces a print with logging.info --- routes/supplementary_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/supplementary_data.py b/routes/supplementary_data.py index 1f2c74e..854a6df 100644 --- a/routes/supplementary_data.py +++ b/routes/supplementary_data.py @@ -32,7 +32,7 @@ def load(self, users: pd.Series) -> None: if self.working_hours.empty: logging.info("Notion working hours table does not exist") else: - print(users) + logging.info(f"Users\n{users}") for index, row in self.working_hours.iterrows(): not_matches = (users == row["User"]).value_counts().loc[False] if not_matches == users.count():