KayleMaster commented on issue #8006: Error out when timezone is not supplied 
with pendulum
URL: https://github.com/apache/airflow/issues/8006#issuecomment-606009126
 
 
   On the top of my head, something like this?
   ```
   import datetime as dt
   from dateutil import tz
   from airflow.operators.bash_operator import BashOperator
   from airflow import DAG
   
   BG_TZ = tz.gettz('Europe/Sofia')
   
   DEFAULT_ARGS = {
       "owner": "airflow",
       "start_date": dt.datetime(2020, 3, 28, tzinfo=BG_TZ),
       "email_on_failure": False,
       "email_on_retry": False,
       "retries": 0,
       "retry_delay": dt.timedelta(minutes=5),
   }
   
   with DAG(
       'test_dag',
       default_args=DEFAULT_ARGS,
       schedule_interval='0,30 * * * *',
       catchup=False,
   ) as test_dag:
   
       t1 = BashOperator(
           task_id="ok",
           bash_command="date -Is; echo ok",
       )
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to