LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
fix: Minor fix in exc middleware, removed extra pyupgrade hook (#245)
Chandrasekharan M70a02ff8333b
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 263c5fd12..181d316ee 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -132,13 +132,6 @@ repos:rev: v1.1.2hooks:- id: htmlhint- - repo: https://github.com/asottile/pyupgrade- rev: v3.15.1- hooks:- - id: pyupgrade- entry: pyupgrade --py38-plus --keep-runtime-typing- types:- - python- repo: https://github.com/igorshubovych/markdownlint-clirev: v0.39.0hooks:diff --git a/backend/account/authentication_controller.py b/backend/account/authentication_controller.pyindex 72c1c2de2..ede02b04a 100644--- a/backend/account/authentication_controller.py+++ b/backend/account/authentication_controller.py@@ -159,7 +159,7 @@ class AuthenticationController:except Exception as ex:#self.user_logout(request)- if ex.code == AuthorizationErrorCode.USF: # type: ignore+ if hasattr(ex, "code") and ex.code == AuthorizationErrorCode.USF: # type: ignoreresponse = Response(status=status.HTTP_412_PRECONDITION_FAILED,data={"domain": ex.data.get("domain")}, # type: ignorediff --git a/backend/middleware/exception.py b/backend/middleware/exception.pyindex 1bb9e91e3..6f4ba637f 100644--- a/backend/middleware/exception.py+++ b/backend/middleware/exception.py@@ -81,7 +81,7 @@ class ExceptionLoggingMiddleware:request (HttpRequest): Request to get API endpoint hitexception (Exception): Exception that was raised to be logged"""- if response.status_code >= 500:+ if hasattr(response, "status_code") and response.status_code >= 500:message = ("{method} {url} {status}\n\n{error}\n\n````{tb}````".format(method=request.method,