1

I am getting the following error :

File "<unknown>", line 1, in template
TemplateSyntaxError: unexpected char u'\\' at 205        

When I include this in my code:

'{{ macros.ds_format(macros.ds_add(ds, -13), "%Y-%m-%d", "%Y%m%d") }}'

I re-typed it in vim in case it was an error with encoding, but still no luck!

whackamadoodle3000
  • 6,684
  • 4
  • 27
  • 44
Xstatic
  • 1,411
  • 1
  • 11
  • 14

1 Answers1

4

Change to this:

"{{ macros.ds_format(macros.ds_add(ds, -13), '%Y-%m-%d', '%Y%m%d') }}"

Airflow jinja templates does not accept " in the middle of your template. I've had this same problem using this same ds_format macro. Always represents strings inside your template with ', for example: 'my_string', and it should work.

Kevin Barranco
  • 349
  • 2
  • 7