Skip to content

Commit

Permalink
remove transformer (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazelmat authored Jun 27, 2024
1 parent 9d6d89a commit c599672
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 44 deletions.
18 changes: 6 additions & 12 deletions dags/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import csv
import io
import math
import re
from urllib.parse import urlparse
from importlib import import_module
from pathlib import Path
from urllib.parse import urlparse

import pandas as pd
import requests
from fuzzywuzzy import fuzz
from shapely import wkb
from shapely.geometry import Point
import math
from pyproj import Transformer
from fuzzywuzzy import fuzz

env = Path(__file__).parent.parent.name

Expand Down Expand Up @@ -359,18 +359,12 @@ def check_siret_using_annuaire_entreprise(row, adresse_query_flag=False, col="si
return res


transformer = Transformer.from_crs("EPSG:2154", "EPSG:4326")


def get_location(easting, northing):
def get_location(lon: float, lat: float) -> dict:
try:
easting = float(easting)
northing = float(northing)

if math.isnan(easting) or math.isnan(northing):
if math.isnan(float(lon)) or math.isnan(float(lat)):
return None

lon, lat = transformer.transform(easting, northing)
location = transform_location(longitude=lon, latitude=lat)

return {"latitude": lat, "longitude": lon, "location": location}
Expand Down
3 changes: 1 addition & 2 deletions dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ apache-airflow
apache-airflow-providers-postgres
shapely
ratelimit
pyproj
fuzzywuzzy
python-Levenshtein
python-Levenshtein
30 changes: 0 additions & 30 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ certifi==2023.7.22 \
# -c requirements.txt
# httpcore
# httpx
# pyproj
# requests
cffi==1.16.0 \
--hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \
Expand Down Expand Up @@ -1603,35 +1602,6 @@ pyjwt==2.8.0 \
# apache-airflow
# flask-appbuilder
# flask-jwt-extended
pyproj==3.6.1 \
--hash=sha256:18faa54a3ca475bfe6255156f2f2874e9a1c8917b0004eee9f664b86ccc513d3 \
--hash=sha256:1e9fbaf920f0f9b4ee62aab832be3ae3968f33f24e2e3f7fbb8c6728ef1d9746 \
--hash=sha256:2d6ff73cc6dbbce3766b6c0bce70ce070193105d8de17aa2470009463682a8eb \
--hash=sha256:36b64c2cb6ea1cc091f329c5bd34f9c01bb5da8c8e4492c709bda6a09f96808f \
--hash=sha256:38a3361941eb72b82bd9a18f60c78b0df8408416f9340521df442cebfc4306e2 \
--hash=sha256:447db19c7efad70ff161e5e46a54ab9cc2399acebb656b6ccf63e4bc4a04b97a \
--hash=sha256:44aa7c704c2b7d8fb3d483bbf75af6cb2350d30a63b144279a09b75fead501bf \
--hash=sha256:4ba1f9b03d04d8cab24d6375609070580a26ce76eaed54631f03bab00a9c737b \
--hash=sha256:4bc0472302919e59114aa140fd7213c2370d848a7249d09704f10f5b062031fe \
--hash=sha256:50100b2726a3ca946906cbaa789dd0749f213abf0cbb877e6de72ca7aa50e1ae \
--hash=sha256:5279586013b8d6582e22b6f9e30c49796966770389a9d5b85e25a4223286cd3f \
--hash=sha256:6420ea8e7d2a88cb148b124429fba8cd2e0fae700a2d96eab7083c0928a85110 \
--hash=sha256:65ad699e0c830e2b8565afe42bd58cc972b47d829b2e0e48ad9638386d994915 \
--hash=sha256:6d227a865356f225591b6732430b1d1781e946893789a609bb34f59d09b8b0f8 \
--hash=sha256:7a27151ddad8e1439ba70c9b4b2b617b290c39395fa9ddb7411ebb0eb86d6fb0 \
--hash=sha256:80fafd1f3eb421694857f254a9bdbacd1eb22fc6c24ca74b136679f376f97d35 \
--hash=sha256:83039e5ae04e5afc974f7d25ee0870a80a6bd6b7957c3aca5613ccbe0d3e72bf \
--hash=sha256:8b8acc31fb8702c54625f4d5a2a6543557bec3c28a0ef638778b7ab1d1772132 \
--hash=sha256:9274880263256f6292ff644ca92c46d96aa7e57a75c6df3f11d636ce845a1877 \
--hash=sha256:ab7aa4d9ff3c3acf60d4b285ccec134167a948df02347585fdd934ebad8811b4 \
--hash=sha256:c41e80ddee130450dcb8829af7118f1ab69eaf8169c4bf0ee8d52b72f098dc2f \
--hash=sha256:db3aedd458e7f7f21d8176f0a1d924f1ae06d725228302b872885a1c34f3119e \
--hash=sha256:e7e13c40183884ec7f94eb8e0f622f08f1d5716150b8d7a134de48c6110fee85 \
--hash=sha256:ebfbdbd0936e178091309f6cd4fcb4decd9eab12aa513cdd9add89efa3ec2882 \
--hash=sha256:fd43bd9a9b9239805f406fd82ba6b106bf4838d9ef37c167d3ed70383943ade1 \
--hash=sha256:fd93c1a0c6c4aedc77c0fe275a9f2aba4d59b8acf88cebfc19fe3c430cfabf4f \
--hash=sha256:fffb059ba3bced6f6725961ba758649261d85ed6ce670d3e3b0a26e81cf1aa8d
# via -r dev-requirements.in
pytest==8.2.2 \
--hash=sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343 \
--hash=sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977
Expand Down

0 comments on commit c599672

Please sign in to comment.