Skip to content

Commit bf124a4

Browse files
committed
[MV] Remove fractional zeroes in ids
Apparently some of the value were returned as floats where they should have been ints
1 parent fb52281 commit bf124a4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

jedeschule/spiders/mecklenburg_vorpommern.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
from jedeschule.spiders.school_spider import SchoolSpider
77

88

9+
def as_string(value: str):
10+
try:
11+
return str(int(value))
12+
except ValueError:
13+
return value
14+
15+
916
class MecklenburgVorpommernSpider(SchoolSpider):
1017
name = "mecklenburg-vorpommern"
1118
# The state provides the data as an Excel file. The current year's
@@ -32,7 +39,7 @@ def parse(self, response):
3239
def normalize(item: Item) -> School:
3340
return School(
3441
name=item.get("NAME1"),
35-
id="MV-{}".format(item.get("DIENSTSTELLEN-NUMMER")),
42+
id="MV-{}".format(as_string(item.get("DIENSTSTELLEN-NUMMER"))),
3643
address=item.get("STRASSE"),
3744
address2="",
3845
zip=item.get("PLZ"),

0 commit comments

Comments
 (0)