fix python 3.8 compat for edoxid calendar sync
apache/airflow:2.7.1 base image ships Python 3.8, which doesn't have zoneinfo (3.9+) and can't evaluate `X | Y` / list[X] type hints at runtime (3.10+). Add `from __future__ import annotations` everywhere and swap zoneinfo -> pytz (already a dependency in this repo).
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import pytz
|
||||
|
||||
from scripts.edoxid_calendar_config import (
|
||||
get_db_config,
|
||||
@@ -22,7 +25,7 @@ from scripts.edoxid_calendar_state_store import StateStore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
JAKARTA_TZ = ZoneInfo("Asia/Jakarta")
|
||||
JAKARTA_TZ = pytz.timezone("Asia/Jakarta")
|
||||
|
||||
# Toleransi jendela waktu untuk cek reminder — harus >= interval polling DAG (5 menit)
|
||||
# supaya tidak ada window yang "kelewat" di antara 2 run.
|
||||
|
||||
Reference in New Issue
Block a user