From 4141648d06811bcb93cf324137e123e17ef4a84b Mon Sep 17 00:00:00 2001 From: jameshod5 Date: Fri, 10 May 2024 14:53:02 +0100 Subject: [PATCH] merge from test_db --- src/api/main.py | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/api/main.py b/src/api/main.py index c0e0134..f3159ad 100644 --- a/src/api/main.py +++ b/src/api/main.py @@ -1,13 +1,47 @@ -import os -import uuid -from typing import List, Optional - import sqlmodel -from fastapi import Depends, FastAPI, Query, Request, Response +import uuid +import h5py +from typing import List, get_type_hints, Annotated, Optional + +from fastapi import ( + Depends, + Query, + FastAPI, + HTTPException, + Request, + Response, +) +from fastapi.responses import ( + HTMLResponse, + StreamingResponse, + JSONResponse, + FileResponse, + RedirectResponse, +) from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates +from fastapi.encoders import jsonable_encoder + from sqlalchemy.orm import Session + from strawberry.asgi import GraphQL +from strawberry.fastapi import GraphQLRouter + +import pandas as pd +import json +import ndjson +import io +import os +from . import crud, models, graphql, utils +from .types import FileType +from .page import MetadataPage +from .utils import InputParams +from .database import SessionLocal, engine, get_db +from pydantic import BaseModel, Field, create_model +from fastapi_pagination import Page, add_pagination +from fastapi_pagination.ext.sqlalchemy import paginate +from fastapi_pagination.cursor import CursorPage +from strawberry.fastapi import GraphQLRouter from strawberry.http import GraphQLHTTPResponse from strawberry.types import ExecutionResult from .models import SignalModel, ShotModel, SourceModel, ScenarioModel, CPFSummaryModel