Skip to content

Commit

Permalink
fixed errors when updating name of run
Browse files Browse the repository at this point in the history
  • Loading branch information
visualDust committed Oct 8, 2024
1 parent e2c8c49 commit 421c429
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions neetbox/server/fastapi/routers/project/_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ async def get_status_of(project_id, run_id):
async def set_get_metadata_of_run_id(project_id: str, run_id: str, metadata: dict = Body(...)):
bridge = Bridge.of_id(project_id)
try:
old_metadata = bridge.historyDB.fetch_metadata_of_run_id(run_id=run_id) # get old metadata
old_metadata.update(metadata)
metadata_in_db = bridge.historyDB.fetch_metadata_of_run_id(

Check warning on line 110 in neetbox/server/fastapi/routers/project/_crud.py

View check run for this annotation

Codecov / codecov/patch

neetbox/server/fastapi/routers/project/_crud.py#L110

Added line #L110 was not covered by tests
run_id=run_id
) # get old metadata
metadata_in_db.update(metadata)

Check warning on line 113 in neetbox/server/fastapi/routers/project/_crud.py

View check run for this annotation

Codecov / codecov/patch

neetbox/server/fastapi/routers/project/_crud.py#L113

Added line #L113 was not covered by tests
# Assuming the method to update metadata in your database might look like this
bridge.historyDB.update_metadata_of_run_id(run_id=run_id, metadata=old_metadata)
return bridge.historyDB.fetch_metadata_of_run_id(run_id=run_id)
# bridge.historyDB.update_metadata_of_run_id(run_id=run_id, metadata=old_metadata)
return bridge.historyDB.fetch_metadata_of_run_id(run_id=run_id, metadata=metadata_in_db)

Check warning on line 116 in neetbox/server/fastapi/routers/project/_crud.py

View check run for this annotation

Codecov / codecov/patch

neetbox/server/fastapi/routers/project/_crud.py#L116

Added line #L116 was not covered by tests
except Exception as e: # Replace with your specific database exception
logger.debug(f"failed to update metadata of run_id {run_id}: {e}")

Check warning on line 118 in neetbox/server/fastapi/routers/project/_crud.py

View check run for this annotation

Codecov / codecov/patch

neetbox/server/fastapi/routers/project/_crud.py#L118

Added line #L118 was not covered by tests
raise HTTPException(status_code=404, detail={ERROR_KEY: str(e)})


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "neetbox"
version = "0.4.11"
version = "0.4.12"
description = "Logging/Debugging/Tracing/Managing/Facilitating long running python projects, especially a replacement of tensorboard for deep learning projects"
license = "MIT"
authors = ["VisualDust <[email protected]>", "Lideming <[email protected]>"]
Expand Down

0 comments on commit 421c429

Please sign in to comment.