title: AIRFLOW: use .replace() or relativedelta() in jinja template for {{ds}}
body: <p>My goal is to return 1st day of previous month based on airflow macro variable {{ds}} and use it e.g. in HiveOperator.</p>
  <p>E.g. For ds = 2020-05-09 I expect to return: 2020-04-01</p>
  <p>The solution I found and tried were:</p>
  <pre><code>SET hivevar:LAST_MONTH='{{ (ds.replace(day=1) - macros.timedelta(days=1)).replace(day=1) }}';
  SET hivevar:LAST_MONTH='{{ ds + macros.dateutil.relativedelta.relativedelta(months=-1, day=1) }}'
  </code></pre>
  <p>But both resulted in errors:</p>
  <pre><code>Error rendering template: replace() takes no keyword arguments 
  
  Error rendering template: must be str, not relativedelta 
  </code></pre>
  <p>and when rendered didn't show any dates.</p>
  <p>What am I doing wrong?</p>