Skip to content

Commit bbddba3

Browse files
davenquinngithub-actions[bot]
authored andcommitted
Format code and sort imports
1 parent 9131ffd commit bbddba3

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

services/api-v3/api/app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
import dotenv
44
import uvicorn
5+
from api.routes.dev_routes.convert import convert_router
56
from fastapi import FastAPI
67
from fastapi.middleware.cors import CORSMiddleware
78

8-
from api.routes.dev_routes.convert import convert_router
9-
109
dotenv.load_dotenv()
1110

1211
import api.routes.security
1312
from api.database import connect_engine, dispose_engine
13+
from api.map import router as map_router
1414
from api.match import router as match_router
1515
from api.routes.ingest import router as ingest_router
1616
from api.routes.object import router as object_router
1717
from api.routes.sources import router as sources_router
18-
from api.map import router as map_router
1918

2019

2120
@asynccontextmanager

services/api-v3/api/map/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
from typing import Annotated
22

33
import morecantile
4-
from fastapi import APIRouter, HTTPException
5-
from fastapi import Depends
4+
from api.database import get_sync_database
5+
from fastapi import APIRouter, Depends, HTTPException
66
from morecantile import Tile
77
from shapely import GEOSException
88
from shapely.geometry import Polygon
99
from shapely.wkb import loads as load_wkb
1010
from shapely.wkt import loads as load_wkt
1111

12-
from api.database import get_sync_database
13-
1412
router = APIRouter(tags=["map"])
1513

1614
tms = morecantile.tms.get("WebMercatorQuad")
@@ -129,8 +127,9 @@ def get_map_legend(
129127
detail="Only 'carto' compilation is currently supported.",
130128
)
131129

132-
res = db.run_query(
133-
"""
130+
res = (
131+
db.run_query(
132+
"""
134133
WITH polygons AS (
135134
SELECT legend_id, source_id, scale
136135
FROM carto.polygons p
@@ -168,7 +167,10 @@ def get_map_legend(
168167
JOIN maps.sources s USING (source_id)
169168
JOIN polygons p USING (legend_id, source_id)
170169
""",
171-
params={"bounds": map_area.bounds.wkt, "scale": scale},
172-
).mappings().all()
170+
params={"bounds": map_area.bounds.wkt, "scale": scale},
171+
)
172+
.mappings()
173+
.all()
174+
)
173175

174176
return res

0 commit comments

Comments
 (0)