Skip to content

Commit 89d49c2

Browse files
committed
Make returns explicit
1 parent 95f2a75 commit 89d49c2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tasks/make_boundaries/src/usecases/make_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# This is where we do content-specific processing for each admin layer
1313
# before merging them all into one JSON file which we convert to versatiles
1414
# See: https://wiki.openstreetmap.org/wiki/File:Administrative_Gliederung_Deutschlands_admin_level.png
15-
def make_admin(cache_dir: str, output_dir: str, date: date):
15+
def make_admin(cache_dir: str, output_dir: str, date: date) -> list[str]:
1616

1717
# 1. Fetch the BKG data we need
1818
ds = date.strftime("%Y-%m-%d")
@@ -94,6 +94,6 @@ def make_admin(cache_dir: str, output_dir: str, date: date):
9494
make_versatiles(json_path, versatiles_path, tilejson_path, date)
9595
except Exception:
9696
print(f"Failed to build {versatiles_path}")
97-
return
97+
return []
9898

9999
return [versatiles_path]

tasks/make_boundaries/src/usecases/make_admin_labels.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def get_label_point(x: geometry.Polygon | geometry.MultiPolygon):
3030
)
3131

3232

33-
def make_admin_labels(cache_dir: str, output_dir: str, date: datetime.date):
33+
def make_admin_labels(
34+
cache_dir: str, output_dir: str, date: datetime.date
35+
) -> list[str]:
3436

3537
# 1. Fetch the BKG data we need
3638
ds = date.strftime("%Y-%m-%d")
@@ -132,6 +134,6 @@ def make_admin_labels(cache_dir: str, output_dir: str, date: datetime.date):
132134
)
133135
except Exception:
134136
print(f"Failed to build {versatiles_path}")
135-
return
137+
return []
136138

137139
return [versatiles_path]

0 commit comments

Comments
 (0)