Skip to content

Commit 3d1c57e

Browse files
committed
fix(lint): satisfy ruff and mypy on databricks and institutions
- Remove unused HTTPException import from databricks.py (F401) - Cast ORM row in _require_single_institution_row_by_uuid for InstTable (no-any-return) Made-with: Cursor
1 parent 83b8f61 commit 3d1c57e

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/webapp/databricks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from .config import databricks_vars, gcs_vars
1717
from .utilities import databricksify_inst_name, SchemaType
1818
from typing import List, Any, Dict, Optional
19-
from fastapi import HTTPException
2019
import requests
2120
import hashlib
2221
import json

src/webapp/routers/institutions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import re
44

5-
from typing import Annotated, Any, Dict, Optional, Tuple
5+
from typing import Annotated, Any, Dict, Optional, Tuple, cast
66
from fastapi import HTTPException, status, APIRouter, Depends
77
from pydantic import BaseModel
88
from sqlalchemy.orm import Session
@@ -268,7 +268,7 @@ def _require_single_institution_row_by_uuid(sess: Session, inst_id: str) -> Inst
268268
detail="Unexpected number of institutions found with this id. Expected 1 got "
269269
+ str(len(query_result)),
270270
)
271-
return query_result[0][0]
271+
return cast(InstTable, query_result[0][0])
272272

273273

274274
def _persist_institution_patch_row_fields(

0 commit comments

Comments
 (0)