0

I have the following code:

from datetime import datetime ,timedelta
import airflow.macros

args = {
    'owner': 'Airflow',
    'start_date': datetime(2018, 07, 01),
    'retries': 3,
    'retry_delay': timedelta(minutes=10)
}

This shows no errors:

working image

All I do is change the month from 07 to 08 and this generates :

error image

Sorry images are not shown directly.. I have insufficient credit for it so it's shown as link :(

Notice how the datetime package becomes "unused"

The errors are:

Unresolved refrence datetime
statment expected , found PY:Colon

What is the problem?

Programmer120
  • 2,362
  • 9
  • 30
  • 48

1 Answers1

0

Use 7 and 1 instead of 07 and 01. It will treat the number starting with 0 as octal number in python 2.7. Thats why 08 will be an invalid case in octal. Here is an stackoverflow link. In Python 3.0 it has been changed from 0 to 0o

kadekhar
  • 71
  • 3