我有一个 pandas.DataFrame df
,df.index
它会产生这样的结果:
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)
我在气流上运行 DAG,它在以下行停止df.loc[start_date:end_date]
,说:
AttributeError: 'Pendulum' object has no attribute 'nanosecond'
如果不在 Airflow 中运行代码,我将无法重现该错误。相同的代码在没有 Airflow 的情况下运行得很好。
是Airflow宏并且start_date
是. execution_date
end_date
next_execution_date
我想问题与与&dtype
中的df
不兼容的日期时间有关,但我不知道如何解决它。start_date
end_date
我尝试删除时区,更改dtype
但没有任何效果。