DAG Import Error: KeyError: 'Y'

I been trying to import DAGs into airflow but the same error is appearing in all the DAGs

Has anybody had the same issue? I only use dates in the scheduler parameters

Example:

DEFAULT_ARGS = {
“owner”: “airflow”,
“depends_on_past”: False,
“email”: [“email@email.com”],
“start_date”: pendulum.datetime(year=2020, month=8, day=20),
“email_on_failure”: False,
“email_on_retry”: False,
}

Begin DAG logic

dag = DAG(
DAG_ID,
default_args=DEFAULT_ARGS,
dagrun_timeout=timedelta(hours=3),
schedule_interval=None,
max_active_runs=1,
)

My first guess is that start_date requires a datetime object, not the Pendulum datetime object.

You may try to convert it to a datetime object first.

from datetime import datetime
...

p = pendulum.datetime(year=2020, month=8, day=20)
start_date = datetime.fromisoformat(p.to_datetime_string())
DEFAULT_ARGS = {
    ...
    "start_date": start_date,
    ...
}

Alternatively, we can try timezone in the airflow.utils module:

from airflow.utils import timezone


DEFAULT_ARGS = {
    ...
    "start_date": timezone.datetime(2020, 8, 20),
    ...
}