I have a pandas.DataFrame df
with df.index
which yeilds something like this:
DatetimeIndex(['2014-10-06 00:55:11.357899904',
'2014-10-06 00:56:39.046799898',
'2014-10-06 00:56:39.057499886',
'2014-10-06 00:56:40.684299946',
'2014-10-06 00:56:41.115299940',
'2014-10-06 01:03:52.764300108',
'2014-10-06 01:21:18.448499918',
'2014-10-06 01:21:18.457200050',
'2014-10-06 01:21:18.584199905',
'2014-10-06 01:21:18.594700098',
...
'2014-11-05 00:25:47.996000051',
'2014-11-05 00:56:45.081799984',
'2014-11-05 00:56:45.096899986',
'2014-11-05 05:50:57.639699936',
'2014-11-05 06:08:56.365000010',
'2014-11-05 06:11:20.519099950',
'2014-11-05 06:15:03.470400095',
'2014-11-05 06:15:03.981600046',
'2014-11-05 06:25:31.514300108',
'2014-11-05 06:25:59.310400009'],
dtype='datetime64[ns]', name='time', length=1000, freq=None)
I am running a DAG on airflow, which stops at the following line df.loc[start_date:end_date]
, saying that:
AttributeError: 'Pendulum' object has no attribute 'nanosecond'
I cannot reproduce the error without running the code in Airflow. The same code runs just fine without Airflow.
The start_date
is the Airflow macro execution_date
and end_date
is the next_execution_date
.
I guess the issues is to do with the date-time dtype
of the df
not being compatable with the ones from the start_date
& end_date
, but I have no idea how to address it.
I tried removing time zones, changing the dtype
but nothing worked.