Last active
October 10, 2018 14:29
-
-
Save ex-hota911/3afb8f972a16c94a5dc416be221257da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytz | |
| from airflow import models | |
| tz = pytz.timezone('Asia/Tokyo') | |
| def in_jst(execution_date): | |
| """Returns the execution date in JST.""" | |
| return tz.fromutc(execution_date) | |
| def ds_in_jst(execution_date): | |
| """Returns the ISO format date string of execution date in JST.""" | |
| returns in_jst(execution_date).date().isoformat() | |
| with models.DAG( | |
| dag_id="dag", | |
| # Run DAG at 3 am in JST. | |
| schedule_interval="0 18 * * *", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment