{#
Copyright 2018 Etsy Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
#}
# -*- coding: utf-8 -*-
#
# This file was auto-generated at {{ build_time }} by {{ library_name }}, version {{ library_version }}.
#
#                           DO NOT EDIT!
#
# The configuration that generated this DAG was:
#   filename: {{ metadata.filename }}
#       date: {{ build_time }}
#        md5: {{ config_md5 }}
#
# The configuration contents are below:
###############################################################################
{{ metadata.yaml_config | comment }}
###############################################################################
#

import os
import re
from airflow import DAG

{% for module in imports.modules %}
import {{module}}
{% endfor %}

{% for (module, objects) in imports.objects.items() %}
{% if '*' in objects %}
from {{ module }} import *
{% else %}
from {{ module }} import {{ ', '.join(objects) }}
{% endif %}
{% endfor %}

DEFAULT_TASK_ARGS = {
{% for (arg_name, arg_value) in default_task_args.items() %}
        '{{ arg_name }}': {{ arg_value | format_value }},
{% endfor %}
    }

dag = DAG(
{% for (arg_name, arg_value) in dag_args.items() %}
        {{ arg_name }} = {{ arg_value | format_value }},
{% endfor %}
        default_args = DEFAULT_TASK_ARGS,
    )

