AttributeError: 'datetime.datetime' object has no attribute '__module__' #33495
Unanswered
sschuetz2bit
asked this question in
Q&A
Replies: 1 comment
-
Can you please, provide the full stacktrace you have? you only shared the error message but without stacktrace it is useless. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My really simple dag is failing with the error:
.../utils/json.py", line 153, in default
CLASSNAME: o.module + "." + o.class.qualname,
AttributeError: 'datetime.datetime' object has no attribute 'module'
here is my dag:
from airflow import DAG
from airflow.operators.postgres_operator import PostgresOperator
from datetime import datetime , timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2023, 8, 18),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG('etl_pipeline', default_args=default_args, schedule_interval='@daily')
extract_data = PostgresOperator(
task_id="get_data",
postgres_conn_id="test",
sql="SELECT * FROM xx;",
dag=dag
)
load_data = PostgresOperator(
task_id='load_data',
postgres_conn_id='test',
sql='INSERT INTO xx VALUES (...);',
dag=dag )
extract_data >> load_data
I tried Airflow version 2.5.2 and 2.6.0 with Python 3.7, 3.8 and 3.9, still same.
what am i missing?
Beta Was this translation helpful? Give feedback.
All reactions