title: Getting user_defined_filter correct in Airflow
body: <p>I am trying to get a simple Airflow (v1.9.0) <code>user_defined_filters</code> working based on the <a href="https://airflow.apache.org/tutorial.html#templating-with-jinja" rel="nofollow noreferrer">Docs</a>. Here is a minimal example I am trying to get running</p>
  
  <pre><code>def userfilter(id):
      return 'Hello' + id
  
  default_args = {
          'start_date': datetime(2018, 5, 19),
          'user_defined_filters': dict(hello=lambda name: 'Hello%s' % name, filter2=userfilter),
          }
  
  dag = DAG('mwe', default_args=default_args)
  jinja_env = dag.get_template_env()
  print(jinja_env.filters)
  
  t1 = SimpleHttpOperator(
      task_id='helloworld',
  #    endpoint="/api/{{ 'world' | filter2 }}",
      endpoint="/api/{{ 'world' | hello }}",
      method='GET',
      headers=None,
      response_check=None, 
      extra_options=None, 
      xcom_push=True, 
      http_conn_id='myconn',
      dag=dag)
  </code></pre>
  
  <p>Ultimately I want <code>userfilter</code> called with values I pull from <code>xcom</code>. But, even in this simple example, I am getting an exception:</p>
  
  <pre><code>{base_task_runner.py:98} INFO - Subtask File "&lt;unknown&gt;", line 1, in template
  {base_task_runner.py:98} INFO - Subtask: jinja2.exceptions.TemplateAssertionError: no filter named 'hello'`
  </code></pre>
  
  <p><code>print(jinja_env.filters)</code> is also not showing the custom filters that are defined. What am I missing here?</p>