teamclairvoyant/airflow-maintenance-dags

Naive datetime is disallowed in db cleanup dag

JavierLopezT opened this issue · 0 comments

Hello. I have copy-pasted the DAG, set the variables and run the DAG. The XCOM has a correct value of date but I get the following error for all DB objects:

Running Cleanup Process...
[2021-04-01 19:18:01,792] {dag_mnt_db_cleanup.py:234} INFO - INITIAL QUERY : SELECT job.id AS job_id, job.job_type AS job_job_type, job.latest_heartbeat AS job_latest_heartbeat 
FROM job
[2021-04-01 19:18:01,799] {taskinstance.py:1150} ERROR - (builtins.ValueError) naive datetime is disallowed
[SQL: SELECT job.id AS job_id, job.job_type AS job_job_type, job.latest_heartbeat AS job_latest_heartbeat 
FROM job 
WHERE job.latest_heartbeat <= %(latest_heartbeat_1)s]
[parameters: [immutabledict({})]]
Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1204, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 865, in _init_compiled
    for key in compiled_params
  File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 865, in <genexpr>
    for key in compiled_params
  File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py", line 1232, in process
    return process_param(value, dialect)
  File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/sqlalchemy.py", line 98, in process_bind_param
    raise ValueError('naive datetime is disallowed')
ValueError: naive datetime is disallowed

I am using Airflow 1.10.14 with Docker and Python 3.6. What could be the error? Thanks