Skip to content

Commit 6a82e7b

Browse files
author
matthias_schaub
committed
Add type annotations.
1 parent 2a02943 commit 6a82e7b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mapswipe_workers/mapswipe_workers/firebase_to_postgres/archive_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
Archive a project.
33
"""
44

5+
from typing import Iterable
6+
57
from firebase_admin import exceptions
68

79
from mapswipe_workers import auth
810
from mapswipe_workers.definitions import logger
911

1012

11-
def chunks(data, size=250):
13+
def chunks(data: list, size: int = 250) -> Iterable[list]:
1214
"""Yield successive n-sized chunks from list."""
1315
for i in range(0, len(data), size):
1416
yield data[i : i + size]

mapswipe_workers/mapswipe_workers/firebase_to_postgres/delete_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
Delete projects.
33
"""
44

5+
from typing import Iterable
6+
57
from firebase_admin import exceptions
68

79
from mapswipe_workers import auth
810
from mapswipe_workers.definitions import logger
911

1012

11-
def chunks(data, size=250):
13+
def chunks(data: list, size: int = 250) -> Iterable[list]:
1214
"""Yield successive n-sized chunks from list."""
1315
for i in range(0, len(data), size):
1416
yield data[i : i + size]

0 commit comments

Comments
 (0)