From 1442c54080560123d013d803231e3e4dbca70cad Mon Sep 17 00:00:00 2001 From: David Tam Date: Thu, 19 Sep 2024 12:02:29 -0700 Subject: [PATCH] lint --- guardrails_api/app.py | 3 +-- guardrails_api/cli/start.py | 1 + guardrails_api/clients/cache_client.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/guardrails_api/app.py b/guardrails_api/app.py index e591c4f..eb1dd8a 100644 --- a/guardrails_api/app.py +++ b/guardrails_api/app.py @@ -19,7 +19,6 @@ import os from starlette.middleware.base import BaseHTTPMiddleware -from starlette.requests import Request class RequestInfoMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next): @@ -50,6 +49,7 @@ async def dispatch(self, request: Request, call_next): response = await call_next(request) return response + # Custom JSON encoder class CustomJSONEncoder(json.JSONEncoder): def default(self, o): @@ -103,7 +103,6 @@ def create_app( # Initialize FastAPIInstrumentor FastAPIInstrumentor.instrument_app(app) - # Add CORS middleware app.add_middleware( CORSMiddleware, diff --git a/guardrails_api/cli/start.py b/guardrails_api/cli/start.py index d1844eb..95d93d2 100644 --- a/guardrails_api/cli/start.py +++ b/guardrails_api/cli/start.py @@ -5,6 +5,7 @@ from guardrails_api.utils.configuration import valid_configuration import uvicorn + @cli.command("start") def start( env: Optional[str] = typer.Option( diff --git a/guardrails_api/clients/cache_client.py b/guardrails_api/clients/cache_client.py index 869162a..4ddace1 100644 --- a/guardrails_api/clients/cache_client.py +++ b/guardrails_api/clients/cache_client.py @@ -1,5 +1,4 @@ import threading -from fastapi import FastAPI from aiocache import caches