Я хочу добавить end_date к моему DAG, однако, когда я запускаю специфицированный c DAG, я получаю указанную выше ошибку. Это кажется странным, потому что я могу обновить дату начала в том же формате, но не дату окончания.
Вот образец моего кода ниже.
default_args = base_args.copy()
default_args['end_date'] = datetime(2020, 5, 5)
dag = DAG(
dag_name,
catchup=True,
default_args=default_args,
schedule_interval=schedule_interval
)
with dag:
extract = BashOperator(
task_id=dag_name
)
А вот Traceback
Traceback (most recent call last):
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/models/__init__.py", line 413, in process_file
m = imp.load_source(mod_name, filepath)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/stevepak/Desktop/airflow/Dags/braintree/braintree_transactions_v3.py", line 40, in <module>
schedule_interval=schedule_interval
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/models/__init__.py", line 3087, in __init__
timezone.convert_to_utc(self.default_args['end_date'])
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/utils/timezone.py", line 92, in convert_to_utc
if not is_localized(value):
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/utils/timezone.py", line 38, in is_localized
return value.utcoffset() is not None
AttributeError: 'tuple' object has no attribute 'utcoffset'
Traceback (most recent call last):
File "/Users/steve/.virtualenvs/airflow/bin/airflow", line 32, in <module>
args.func(args)
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
return f(*args, **kwargs)
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/bin/cli.py", line 647, in test
dag = dag or get_dag(args)
File "/Users/steve/.virtualenvs/airflow/lib/python3.7/site-packages/airflow/bin/cli.py", line 145, in get_dag
'parse.'.format(args.dag_id))