Reference: Examples of using macros with Airflow in Qubole

Description:

This article contains various examples of using macros with Airflow in Qubole.

Example:

a. Getting "today":

-> today = '{{ ds }}'

b. Getting "Day before yesterday":

-> dayBeforeYest = '{{ macros.ds_add(ds, -3)}}’

c. Getting "next week same day":

-> nextWeekSameDay = '{{ macros.ds_add(ds, 7)}}’

Additional Reading
You can also find more information on using Macros with Airflow in Qubole below:
->https://airflow.incubator.apache.org/code.html#macros
Have more questions? Submit a request

Comments

  • Avatar
    Samrat Inabathini

    Hi Pratham,

    Thanks for this notes. But, the macro 'ds' returns the run date of the schedule. Please correct our understanding.

    For example, if we are using backfill command, the 'ds' depends on the start and end dates of backfill. Is our understanding correct, or is there any other complexity involved in this?

Powered by Zendesk