Skip to content

Commit 2cb48ad

Browse files
committed
Merge branch 'main' of github.com:hotosm/geojson-aoi-parser
2 parents 2b99c0d + fbfbc44 commit 2cb48ad

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
# Versioning: Commit messages & changelog
33
- repo: https://github.com/commitizen-tools/commitizen
4-
rev: v4.8.3
4+
rev: v4.9.1
55
hooks:
66
- id: commitizen
77
stages: [commit-msg]
88

99
# Lint / autoformat: Python code
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
1111
# Ruff version.
12-
rev: "v0.12.11"
12+
rev: "v0.13.0"
1313
hooks:
1414
# Run the linter
1515
- id: ruff

geojson_aoi/_async/postgis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
async def __aenter__(self) -> "AsyncPostGis":
5252
"""Initialise the database via context manager."""
5353
await self.create_connection()
54-
54+
5555
async with self.connection.cursor() as cur:
5656
await cur.execute(self.normalize.init_table(self.table_id))
5757

@@ -62,11 +62,11 @@ async def __aenter__(self) -> "AsyncPostGis":
6262
INSERT INTO {} (geometry)
6363
VALUES ({});
6464
""").format(sql.Identifier(self.table_id), sql.SQL(st_functions))
65-
65+
6666
data = (Jsonb(geom),)
6767

6868
await cur.execute(_sql, data)
69-
69+
7070
# NOTE: Potential future polygon merging feature.
7171
# if self.merge:
7272
# cur.execute(self.normalize.merge_disjoints(self.geoms, self.table_id))

geojson_aoi/_sync/postgis.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ class PostGis:
3434
Can reuse an existing upstream connection.
3535
"""
3636

37-
def __init__(
38-
self, db: str | Connection, geoms: list[GeoJSON], merge: bool = False
39-
):
37+
def __init__(self, db: str | Connection, geoms: list[GeoJSON], merge: bool = False):
4038
"""Initialise variables and compose classes."""
4139
self.table_id = uuid4().hex
4240
self.geoms = geoms
@@ -51,7 +49,7 @@ def __init__(
5149
def __enter__(self) -> "PostGis":
5250
"""Initialise the database via context manager."""
5351
self.create_connection()
54-
52+
5553
with self.connection.cursor() as cur:
5654
cur.execute(self.normalize.init_table(self.table_id))
5755

@@ -62,11 +60,11 @@ def __enter__(self) -> "PostGis":
6260
INSERT INTO {} (geometry)
6361
VALUES ({});
6462
""").format(sql.Identifier(self.table_id), sql.SQL(st_functions))
65-
63+
6664
data = (Jsonb(geom),)
6765

6866
cur.execute(_sql, data)
69-
67+
7068
# NOTE: Potential future polygon merging feature.
7169
# if self.merge:
7270
# cur.execute(self.normalize.merge_disjoints(self.geoms, self.table_id))

tests/_async/test_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import warnings
55

66
import pytest
7-
import pytest_asyncio
87

98
from geojson_aoi._async.parser import parse_aoi_async
109

@@ -448,7 +447,10 @@ async def test_warnings_raised_invalid_coords(db):
448447
"properties": {},
449448
}
450449
],
451-
"crs": {"type": "name", "properties": {"name": "urn:ogc:async def:crs:EPSG::4326"}},
450+
"crs": {
451+
"type": "name",
452+
"properties": {"name": "urn:ogc:async def:crs:EPSG::4326"},
453+
},
452454
}
453455
with pytest.warns(UserWarning):
454456
await parse_aoi_async(db, geojson_data)

0 commit comments

Comments
 (0)