Skip to content

Commit 915e433

Browse files
authored
Merge pull request #132 from datakind/ModelCardEndpoint
fixed endpoint issues
2 parents 1f0d7f5 + 571d379 commit 915e433

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/webapp/routers/data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uuid
44
from datetime import datetime, date
55
from databricks.sdk import WorkspaceClient
6-
from typing import Annotated, Any, Dict, List
6+
from typing import Annotated, Any, Dict, List, cast, IO
77
from pydantic import BaseModel
88
from fastapi import APIRouter, Depends, HTTPException, status, Response
99
from fastapi.responses import FileResponse
@@ -1375,7 +1375,8 @@ def get_model_cards(
13751375
try:
13761376
volume_path = f"/Volumes/staging_sst_01/{query_result[0][0].name}_gold/gold_volume/model-card-{model_name}.pdf"
13771377
response = w.files.download(volume_path)
1378-
pdf_bytes = response.contents.read() # pylint: disable=no-member
1378+
stream = cast(IO[bytes], response.contents)
1379+
pdf_bytes = stream.read()
13791380

13801381
except Exception as e:
13811382
raise HTTPException(500, detail=f"Failed to fetch model card: {e}")

0 commit comments

Comments
 (0)