• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Clinical-Genomics / arnold / 7102454002

05 Dec 2023 02:52PM UTC coverage: 0.0%. Remained the same
7102454002

push

github

web-flow
Update to pydantic v2 (#47) (patch)

Added
Move the models to pydantic v2

add Codeowners for automatic reviewer tagging

0 of 89 new or added lines in 5 files covered. (0.0%)

28 existing lines in 5 files now uncovered.

0 of 699 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/arnold/api/api_v1/endpoints/flow_cell.py
1
from arnold.adapter import ArnoldAdapter
×
2
from arnold.crud.read.flow_cell import find_flow_cell, find_all_flow_cells
×
3

4
from arnold.crud import create
×
5
from arnold.models.database.flow_cell import FlowCell
×
6
from typing import List
×
7
from fastapi import APIRouter, Depends, status
×
8
from fastapi.responses import JSONResponse
×
9
import logging
×
10

11
from arnold.settings import get_arnold_adapter
×
12

13
LOG = logging.getLogger(__name__)
×
14

15
router = APIRouter()
×
16

17

18
@router.get("/flow_cell/{flow_cell_id}", response_model=FlowCell)
×
19
def get_flow_cell(
×
20
    flow_cell_id: str,
21
    adapter: ArnoldAdapter = Depends(get_arnold_adapter),
22
):
23
    """fetch a flow_cell by flow_cell id"""
24
    flow_cell: FlowCell = find_flow_cell(flow_cell_id=flow_cell_id, adapter=adapter)
×
25
    return flow_cell
×
26

27

28
@router.get("/flow_cells/", response_model=List[FlowCell])
×
29
def get_flow_cells(
×
30
    adapter: ArnoldAdapter = Depends(get_arnold_adapter),
31
):
32
    """Get all flow_cells"""
33
    flow_cells: List[FlowCell] = find_all_flow_cells(adapter=adapter)
×
34

35
    return flow_cells
×
36

37

38
@router.post("/flow_cell/")
×
39
def create_flow_cell(
×
40
    flow_cell: FlowCell, adapter: ArnoldAdapter = Depends(get_arnold_adapter)
41
) -> JSONResponse:
42
    if find_flow_cell(flow_cell_id=flow_cell.flow_cell_id, adapter=adapter):
×
43
        return JSONResponse(
×
44
            status_code=status.HTTP_405_METHOD_NOT_ALLOWED, content="flow_cell already in database"
45
        )
46
    try:
×
47
        create.create_flow_cell(adapter=adapter, flow_cell=flow_cell)
×
48
    except Exception as e:
×
49
        return JSONResponse(
×
50
            status_code=status.HTTP_405_METHOD_NOT_ALLOWED,
51
            content=f"exception {e} ",
52
        )
53

54
    return JSONResponse(
×
55
        status_code=status.HTTP_200_OK, content=f"flow_cell {flow_cell.flow_cell_id} inserted to db"
56
    )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc