Skip to content

Commit

Permalink
Bugfix in monthly dag for gap_events
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoods25443 committed May 11, 2018
1 parent 88af2ec commit 2a7dece
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions airflow/pipe_events_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def source_date_range(self):
return '{{ yesterday_ds }}', '{{ yesterday_ds }}'
elif self.schedule_interval == '@monthly':
start_date = '{{ (execution_date.replace(day=1) + macros.dateutil.relativedelta.relativedelta(days=-1)).strftime("%Y-%m-%d") }}'
end_date = '{{ (execution_date.replace(day=1) + macros.dateutil.relativedelta.relativedelta(months=1, days=-2)).strftime("%Y%m%d") }}'
end_date = '{{ (execution_date.replace(day=1) + macros.dateutil.relativedelta.relativedelta(months=1, days=-2)).strftime("%Y-%m-%d") }}'
return start_date, end_date
else:
raise ValueError('Unsupported schedule interval {}'.format(self.schedule_interval))
Expand All @@ -39,7 +39,6 @@ def build(self, dag_id):

publish_events = BashOperator(
task_id='publish_events',
depends_on_past=True,
bash_command='{docker_run} {docker_image} gap_events '
'{date_range} '
'{project_id}:{source_dataset}.{position_messages} '
Expand Down

0 comments on commit 2a7dece

Please sign in to comment.