From 1616a8e3f5cc0bd310f3b634707129f52d0058fd Mon Sep 17 00:00:00 2001 From: Janaka Abeywardhana Date: Sat, 14 Sep 2024 13:34:40 +0100 Subject: [PATCH] fix: runtime error in prod due to an invalid import the 'py' module isn't actually a correct dependency, not needed, so not in pyproject.toml. the import must have got auto added by linter by mistake. but didn't blow up locally because I pressume it was installed in the virtual environment --- web/api/spaces_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/api/spaces_handler.py b/web/api/spaces_handler.py index eed5f61d..e8ff9e8b 100644 --- a/web/api/spaces_handler.py +++ b/web/api/spaces_handler.py @@ -1,11 +1,11 @@ """Spaces handler endpoint for the API. /api/spaces handler.""" +import logging from typing import Optional, Self import docq.manage_spaces as m_spaces import docq.run_queries as rq from docq.data_source.list import SpaceDataSources from docq.manage_documents import upload -from py import log from pydantic import BaseModel, ValidationError from tornado.web import HTTPError @@ -97,7 +97,7 @@ def get(self: Self) -> None: spaces_response_model = SpacesResponseModel(response=space_model_list) self.write(spaces_response_model.model_dump(by_alias=True)) except Exception as e: - log.error("Error: ", e) + logging.error("Error: ", e) raise HTTPError(500, reason="Internal server error", log_message=f"Error: {str(e)}") from e