Skip to content

Commit 8e9faad

Browse files
style: auto-format (ruff + oxfmt) [pre-commit.ci]
1 parent 389b2b0 commit 8e9faad

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

backend/geolibre_server/geolibre_server/app/whitebox.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
from fastapi import APIRouter, HTTPException
2020
from pydantic import BaseModel
2121

22-
from . import conversion
2322
from geolibre_server.vector_ops import MAX_FEATURES as MAX_LAYER_FEATURES
23+
24+
from . import conversion
2425
from .runtime import (
2526
RUNTIME_CATALOG_TIMEOUT_SECS,
2627
RUNTIME_DISCOVERY_TIMEOUT_SECS,
@@ -1077,10 +1078,7 @@ def whitebox_run(request: WhiteboxRunRequest):
10771078
if isinstance(features, list) and len(features) > MAX_LAYER_FEATURES:
10781079
raise HTTPException(
10791080
status_code=413,
1080-
detail=(
1081-
f"Layer input for {name} exceeds the "
1082-
f"{MAX_LAYER_FEATURES}-feature limit"
1083-
),
1081+
detail=(f"Layer input for {name} exceeds the {MAX_LAYER_FEATURES}-feature limit"),
10841082
)
10851083
job_id = str(uuid.uuid4())
10861084
now = _utc_now()

backend/geolibre_server/geolibre_server/sedona_ops.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ def run_sql(sql: str, layers: Optional[list[dict]] = None) -> dict:
155155
# Input registration already caps each layer, but a query can still
156156
# expand rows (cross joins, generate_series, etc.). Bound the
157157
# response the same way vector/PostGIS paths bound payloads.
158-
raise SqlInputTooLarge(
159-
f"Query result exceeds the {MAX_FEATURES}-feature limit"
160-
)
158+
raise SqlInputTooLarge(f"Query result exceeds the {MAX_FEATURES}-feature limit")
161159
columns = [str(column) for column in frame.columns]
162160

163161
geometry_column: Optional[str] = None

backend/geolibre_server/tests/test_sql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ def sql(self, statement: str): # noqa: ARG002
157157
def close(self) -> None:
158158
return None
159159

160-
monkeypatch.setattr(sedona_ops, "_import_sedona", lambda: type("M", (), {"connect": staticmethod(lambda: _FakeConnection())})())
160+
monkeypatch.setattr(
161+
sedona_ops,
162+
"_import_sedona",
163+
lambda: type("M", (), {"connect": staticmethod(lambda: _FakeConnection())})(),
164+
)
161165
with pytest.raises(HTTPException) as exc:
162166
sql_run(SqlRunRequest(sql="SELECT 1 AS n UNION ALL SELECT 2 AS n"))
163167
assert exc.value.status_code == 413

0 commit comments

Comments
 (0)