Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naive datetime is disallowed in db cleanup dag #108

Open
JavierLopezT opened this issue Apr 1, 2021 · 0 comments
Open

Naive datetime is disallowed in db cleanup dag #108

JavierLopezT opened this issue Apr 1, 2021 · 0 comments

Comments

@JavierLopezT
Copy link

JavierLopezT commented Apr 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant