我有一个执行dbcleanup操作的dag,在气流1.10.2上运行此dag时,我得到了此错误堆栈跟踪: (任何帮助将不胜感激)
[2019-04-01 17:42:07,661] {models.py:1788} ERROR - (exceptions.ValueError) naive datetime is disallowed [SQL: u'SELECT dag_run.state AS dag_run_state, dag_run.id AS dag_run_id, dag_run.dag_id AS dag_run_dag_id, dag_run.execution_date AS dag_run_execution_date, dag_run.start_date AS dag_run_start_date, dag_run.end_date AS dag_run_end_date, dag_run.run_id AS dag_run_run_id, dag_run.external_trigger AS dag_run_external_trigger, dag_run.conf AS dag_run_conf \nFROM dag_run \nWHERE dag_run.execution_date <= ?'] [parameters: [{}]]
Traceback (most recent call last):
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/airflow/models.py", line 1657, in _run_raw_task
result = task_copy.execute(context=context)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/airflow/operators/python_operator.py", line 103, in execute
return_value = self.execute_callable()
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/airflow/operators/python_operator.py", line 108, in execute_callable
return self.python_callable(*self.op_args, **self.op_kwargs)
File "/Users/adhir/Desktop/aco/audience-wastage-reduction/backend/airflow_dags/utils/dag_utils.py", line 203, in db_cleanup
age_check_column <= max_date,
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2703, in all
return list(self)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
return self._execute_and_instances(context)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1121, in _execute_context
None, None)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1116, in _execute_context
context = constructor(dialect, self, conn, *args)
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 623, in _init_compiled
param.append(processors[key](compiled_params[key]))
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py", line 1074, in process
return impl_processor(process_param(value, dialect))
File "/Users/adhir/miniconda2/lib/python2.7/site-packages/airflow/utils/sqlalchemy.py", line 153, in process_bind_param
raise ValueError('naive datetime is disallowed')
StatementError: (exceptions.ValueError) naive datetime is disallowed [SQL: u'SELECT dag_run.state AS dag_run_state, dag_run.id AS dag_run_id, dag_run.dag_id AS dag_run_dag_id, dag_run.execution_date AS dag_run_execution_date, dag_run.start_date AS dag_run_start_date, dag_run.end_date AS dag_run_end_date, dag_run.run_id AS dag_run_run_id, dag_run.external_trigger AS dag_run_external_trigger, dag_run.conf AS dag_run_conf \nFROM dag_run \nWHERE dag_run.execution_date <= ?'] [parameters: [{}]]
在airflow.config中将default_timezone设置为UTC
试图通过UI和CLI运行dag都给出相同的错误