Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit a8ada79

Browse files
committed
linestrings -> lines
1 parent ea3ef05 commit a8ada79

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

api/database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def to_dict(self):
168168
async def get_table(
169169
conn,
170170
table_id: int,
171-
geometry_type: Literal["polygons", "points", "linestrings"]
171+
geometry_type: Literal["polygons", "points", "lines"]
172172
) -> Table:
173173
metadata = MetaData(schema="sources")
174174
table_slug = await source_id_to_slug(engine, table_id)
@@ -182,7 +182,7 @@ async def get_table(
182182
async def get_sources_sub_table_count(
183183
engine: AsyncEngine,
184184
table_id: int,
185-
geometry_type: Literal["polygons", "points", "linestrings"],
185+
geometry_type: Literal["polygons", "points", "lines"],
186186
query_params: list = None
187187
) -> int:
188188
async with engine.begin() as conn:
@@ -221,7 +221,7 @@ async def get_sources_sub_table_count(
221221
async def select_sources_sub_table(
222222
engine: AsyncEngine,
223223
table_id: int,
224-
geometry_type: Literal["polygons", "points", "linestrings"],
224+
geometry_type: Literal["polygons", "points", "lines"],
225225
page: int = 0,
226226
page_size: int = 100,
227227
query_params: list = None,
@@ -268,7 +268,7 @@ async def select_sources_sub_table(
268268
async def patch_sources_sub_table(
269269
engine: AsyncEngine,
270270
table_id: int,
271-
geometry_type: Literal["polygons", "points", "linestrings"],
271+
geometry_type: Literal["polygons", "points", "lines"],
272272
update_values: dict,
273273
query_params: list = None
274274
) -> CursorResult:

api/routes/sources.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ async def get_sub_sources_geometries(
137137
engine = get_engine()
138138
async with engine.begin() as conn:
139139

140-
for geometry in ["polygons", "linestrings", "points"]:
140+
for geometry in ["polygons", "lines", "points"]:
141141

142142
try:
143143
table = await get_table(conn, table_id, geometry)
@@ -153,7 +153,7 @@ async def get_sub_sources_helper(
153153
response: Response,
154154
request: starlette.requests.Request,
155155
table_id: int,
156-
geometry_type: Literal["polygons", "linestrings", "points"],
156+
geometry_type: Literal["polygons", "lines", "points"],
157157
page: int = 0,
158158
page_size: int = 100
159159
) -> List[Union[PolygonResponseModel, LineStringModel, PointModel]]:
@@ -210,22 +210,22 @@ async def get_sub_sources(
210210
return await get_sub_sources_helper(response, request, table_id, "points", page, page_size)
211211

212212

213-
@router.get("/{table_id}/linestrings", response_model=List[LineStringModel])
213+
@router.get("/{table_id}/lines", response_model=List[LineStringModel])
214214
async def get_sub_sources(
215215
response: Response,
216216
request: starlette.requests.Request,
217217
table_id: int,
218218
page: int = 0,
219219
page_size: int = 100
220220
):
221-
return await get_sub_sources_helper(response, request, table_id, "linestrings", page, page_size)
221+
return await get_sub_sources_helper(response, request, table_id, "lines", page, page_size)
222222

223223

224224
@router.patch("/{table_id}/{geometry_type}")
225225
async def patch_sub_sources(
226226
request: starlette.requests.Request,
227227
table_id: int,
228-
geometry_type: Literal["polygons", "linestrings", "points"],
228+
geometry_type: Literal["polygons", "lines", "points"],
229229
updates: Union[PolygonRequestModel, LineStringModel, PointModel],
230230
user_has_access: bool = Depends(has_access)
231231
) -> List[Union[PolygonResponseModel, LineStringModel, PointModel]]:
@@ -259,7 +259,7 @@ async def patch_sub_sources(
259259
request: starlette.requests.Request,
260260
target_column: str,
261261
table_id: int,
262-
geometry_type: Literal["polygons", "linestrings", "points"],
262+
geometry_type: Literal["polygons", "lines", "points"],
263263
copy_column: CopyColumnRequest,
264264
user_has_access: bool = Depends(has_access),
265265
):

api/tests/sources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def test_get_sources_points_table(self, api_client: TestClient):
8181

8282
assert len(response_json) > 0
8383

84-
def test_get_source_linestrings_table(self, api_client: TestClient):
85-
response = api_client.get(f"/sources/{TEST_SOURCE_TABLE.source_id}/linestrings")
84+
def test_get_source_lines_table(self, api_client: TestClient):
85+
response = api_client.get(f"/sources/{TEST_SOURCE_TABLE.source_id}/lines")
8686
assert response.status_code == 200
8787
response_json = response.json()
8888

0 commit comments

Comments
 (0)