Skip to content

Commit

Permalink
Suppression de l'asterix sur le nom de la ville (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolok authored Nov 19, 2024
1 parent 8385ad8 commit b0015c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dags/utils/base_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def _address_details_extract(address_str):

if city:
city = city.title()
city = city.replace("*", "").strip()

# Ajouter un zéro si le code postal a quatre chiffres
if postal_code and len(postal_code) == 4:
postal_code = "0" + postal_code
Expand Down
5 changes: 5 additions & 0 deletions dags_unit_tests/dags/utils/test_base_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@
{"adresse_format_ban": 'RD 306, Lieudit "La Une" 77240 VERT SAINT DENIS'},
pd.Series(['RD 306, Lieudit "La Une"', "77240", "Vert Saint Denis"]),
),
# Lamballe*
(
{"adresse_format_ban": "Lanjouan 22400 LAMBALLE*"},
pd.Series(["Lanjouan", "22400", "Lamballe"]),
),
],
)
def test_extract_details(input_row, expected_output):
Expand Down

0 comments on commit b0015c0

Please sign in to comment.