Skip to content

Commit ee80f56

Browse files
authored
Merge pull request #117 from datakind/develop
adjust error logging
2 parents 713937b + fc79f66 commit ee80f56

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/webapp/databricks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def run_pdp_inference(
131131
or not check_types(req.filepath_to_type.values(), SchemaType.STUDENT)
132132
):
133133
raise ValueError(
134-
"run_pdp_inference() requires PDP_COURSE and PDP_COHORT type files to run."
134+
"run_pdp_inference() requires COURSE and STUDENT type files to run."
135135
)
136136
w = WorkspaceClient(
137137
host=databricks_vars["DATABRICKS_HOST_URL"],

src/webapp/routers/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
ModelTable,
3131
JobTable,
3232
)
33-
33+
import traceback
34+
import logging
3435
from ..gcsdbutils import update_db_from_bucket
3536

3637
from ..gcsutil import StorageControl
@@ -550,9 +551,11 @@ def trigger_inference_run(
550551
try:
551552
res = databricks_control.run_pdp_inference(db_req)
552553
except Exception as e:
554+
tb = traceback.format_exc()
555+
logging.error(f"Databricks run failure:\n{tb}")
553556
raise HTTPException(
554557
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
555-
detail="Databricks run_pdp_inference error. " + str(e),
558+
detail=f"Databricks run_pdp_inference error. Error = {str(e)}",
556559
) from e
557560
triggered_timestamp = datetime.now()
558561
job = JobTable(

0 commit comments

Comments
 (0)