Fix timezone compare error on osmenrich

develop
Irwan Fathurrahman 2023-10-20 09:29:45 +07:00
rodzic d2040fc09b
commit b9f7988970
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: D4CA0A2970099C20
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -26,6 +26,7 @@ from os.path import join, exists, getsize
from sys import exit, stderr
from time import sleep
from urllib import request
from datetime import timezone
import xmltodict
import yaml
@ -319,7 +320,7 @@ class Enrich(object):
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:

Wyświetl plik

@ -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