Skip to content

Commit 7dcf59b

Browse files
Simon Mandeleyl-macbook-airSimon Mandeleyl-macbook-air
authored andcommitted
PR comments: return None
1 parent 8572fe7 commit 7dcf59b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In details, the IDs are sourced as follows:
2929
|HB| `id` URL query param on the school's detail page (identical to the SNR (Schulnummer) from the overview page) | `HB-937` |✅ likely|
3030
|HH| Field `schul_id` From the WFS Service | `HH-7910-0` |✅ likely|
3131
|HE| `school_no` URL query param of the schools's details page (identical to the Dienststellennummer) | `HE-4024` |✅ likely|
32-
|MV| Column `DIENSTSTELLEN-NUMMER` from the XLSX file | `MV-75130302` |✅ likely|
32+
|MV| Field `dstnr` from the WFS | `MV-75130302` |✅ likely|
3333
|NI| Field `schulnr` from the JSON in the details payload | `NI-67763` |✅ likely|
3434
|NW| Column `Schulnummer` from the CSV | `NW-162437` |✅ likely|
3535
|RP| `Schulnummer` from the school's details page | `RP-50720` |✅ likely|

jedeschule/spiders/mecklenburg_vorpommern.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def _extract_school_data(school):
7070
@staticmethod
7171
def normalize(item: Item) -> School:
7272
def safe_strip(value):
73-
return value.strip() if value is not None else ""
73+
if not value or not value.strip():
74+
return None
75+
return value.strip()
7476

7577
return School(
7678
name=safe_strip(item.get("schulname")),

test/test_mecklenburg_vorpommern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_parse(self):
7777
self.assertEqual(parsed_school["director"], "Frau Beuster")
7878
self.assertEqual(parsed_school["phone"], "038461 - 52006")
7979
self.assertEqual(parsed_school["email"], "schulleitung1108@hotmail.de")
80-
self.assertEqual(parsed_school["website"], "")
80+
self.assertIsNone(parsed_school["website"])
8181

8282

8383
if __name__ == "__main__":

0 commit comments

Comments
 (0)