Skip to content

Commit

Permalink
Fix timezone compare error on osmenrich
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Oct 20, 2023
1 parent d2040fc commit b9f7988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docker-osmenrich/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from sys import exit, stderr
from time import sleep
from urllib import request
from datetime import timezone

import xmltodict
import yaml
Expand Down Expand Up @@ -319,7 +320,7 @@ def get_osm_enrich_new_data(self, from_osm, from_database):
if osm_id and row:
allow_updated = False
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=None)
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=timezone.utc)
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
allow_updated = True
if allow_updated:
Expand Down
4 changes: 2 additions & 2 deletions docker-osmenrich/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psycopg2-binary==2.9.4
psycopg2-binary==2.9.9
python-dateutil==2.8.2
PyYAML==6.0
PyYAML==6.0.1
xmltodict==0.13.0

0 comments on commit b9f7988

Please sign in to comment.