Skip to content

Commit b9f7988

Browse files
committed
Fix timezone compare error on osmenrich
1 parent d2040fc commit b9f7988

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docker-osmenrich/enrich.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from sys import exit, stderr
2727
from time import sleep
2828
from urllib import request
29+
from datetime import timezone
2930

3031
import xmltodict
3132
import yaml
@@ -319,7 +320,7 @@ def get_osm_enrich_new_data(self, from_osm, from_database):
319320
if osm_id and row:
320321
allow_updated = False
321322
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
322-
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=None)
323+
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=timezone.utc)
323324
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
324325
allow_updated = True
325326
if allow_updated:

docker-osmenrich/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
psycopg2-binary==2.9.4
1+
psycopg2-binary==2.9.9
22
python-dateutil==2.8.2
3-
PyYAML==6.0
3+
PyYAML==6.0.1
44
xmltodict==0.13.0

0 commit comments

Comments
 (0)