Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/libkernelbot/leaderboard_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def create_leaderboard(
gpu_types: list | str,
) -> int:
# to prevent surprises, ensure we have specified a timezone
Comment on lines 81 to 83
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 83 mentions ensuring a timezone is specified, but the corresponding assertion has been removed. This comment should be updated or removed to avoid confusion.

Suggested change
gpu_types: list | str,
) -> int:
# to prevent surprises, ensure we have specified a timezone

Copilot uses AI. Check for mistakes.
assert deadline.tzinfo is not None
try:
task = definition.task
self.cursor.execute(
Expand Down Expand Up @@ -260,17 +259,14 @@ def validate_identity(
(identifier,),
)
row = self.cursor.fetchone()
return {
"user_id": row[0],
"user_name": row[1],
"id_type":id_type.value
} if row else None
return (
{"user_id": row[0], "user_name": row[1], "id_type": id_type.value} if row else None
)
Comment on lines +262 to +264
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The parentheses around the return statement are unnecessary. The conditional expression can be returned directly without wrapping parentheses.

Suggested change
return (
{"user_id": row[0], "user_name": row[1], "id_type": id_type.value} if row else None
)
return {"user_id": row[0], "user_name": row[1], "id_type": id_type.value} if row else None

Copilot uses AI. Check for mistakes.
except psycopg2.Error as e:
self.connection.rollback()
logger.exception("Error validating %s %s", human_label, identifier, exc_info=e)
raise KernelBotError(f"Error validating {human_label}") from e


def create_submission(
self,
leaderboard: str,
Expand Down Expand Up @@ -390,7 +386,6 @@ def update_heartbeat_if_active(self, sub_id: int, ts: datetime.datetime) -> None
logger.error("Failed to upsert submission job status. sub_id: '%s'", sub_id, exc_info=e)
raise KernelBotError("Error updating job status") from e


def upsert_submission_job_status(
self,
sub_id: int,
Expand Down
Loading