Skip to content

Commit

Permalink
fix(framework:skip) Fix the SqliteState.get_run method (#4222)
Browse files Browse the repository at this point in the history
  • Loading branch information
panh99 authored Sep 19, 2024
1 parent efdb900 commit a70449d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/py/flwr/server/superlink/state/sqlite_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,18 +782,18 @@ def get_run(self, run_id: int) -> Optional[Run]:
# Convert the uint64 value to sint64 for SQLite
sint64_run_id = convert_uint64_to_sint64(run_id)
query = "SELECT * FROM run WHERE run_id = ?;"
try:
row = self.query(query, (sint64_run_id,))[0]
rows = self.query(query, (sint64_run_id,))
if rows:
row = rows[0]
return Run(
run_id=convert_sint64_to_uint64(row["run_id"]),
fab_id=row["fab_id"],
fab_version=row["fab_version"],
fab_hash=row["fab_hash"],
override_config=json.loads(row["override_config"]),
)
except sqlite3.IntegrityError:
log(ERROR, "`run_id` does not exist.")
return None
log(ERROR, "`run_id` does not exist.")
return None

def acknowledge_ping(self, node_id: int, ping_interval: float) -> bool:
"""Acknowledge a ping received from a node, serving as a heartbeat."""
Expand Down

0 comments on commit a70449d

Please sign in to comment.