From 6f79f8c8ce2612ec8e029ff33137c87dd90e2b3f Mon Sep 17 00:00:00 2001 From: elijahbenizzy Date: Thu, 21 Mar 2024 15:26:22 -0700 Subject: [PATCH 1/2] Fixes off-by-one error in max sequence ID for web UI --- burr/tracking/server/backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/burr/tracking/server/backend.py b/burr/tracking/server/backend.py index 1c42de79..ab2bdfa8 100644 --- a/burr/tracking/server/backend.py +++ b/burr/tracking/server/backend.py @@ -96,7 +96,7 @@ async def list_projects(self, request: fastapi.Request) -> Sequence[schema.Proje ) return out - async def get_max_sequence_id(self, file_path: str) -> int: + async def get_number_of_steps(self, file_path: str) -> int: """Quick tool to get the latest sequence ID from a log file. This is not efficient and should be replaced.""" count = 0 @@ -105,7 +105,8 @@ async def get_max_sequence_id(self, file_path: str) -> int: line_data = json.loads(line) if "sequence_id" in line_data: # Just return the latest for now - return line_data["sequence_id"] + # We add one as it is the count, not the index + return line_data["sequence_id"] + 1 return count async def list_apps( @@ -136,7 +137,7 @@ async def list_apps( partition_key=metadata.partition_key, first_written=await aiofilesos.path.getctime(full_path), last_written=await aiofilesos.path.getmtime(full_path), - num_steps=await self.get_max_sequence_id(log_path), + num_steps=await self.get_number_of_steps(log_path), tags={}, ) ) From a5775b26e13c17557dc0b7bdf4add70ae05a7444 Mon Sep 17 00:00:00 2001 From: elijahbenizzy Date: Thu, 21 Mar 2024 15:26:56 -0700 Subject: [PATCH 2/2] bumps version from 0.10.0 to 0.10.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c66b52cb..bb5c98fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "burr" -version = "0.10.0" +version = "0.10.1" dependencies = [] # yes, there are none requires-python = ">=3.9" authors = [