Yes. The crontab you specified is not "standard". Airflow's crontab
supports classic cron specification: (example here)
https://www.adminschoice.com/crontab-quick-reference
Custom timetable is the right way to go for you. You can also run the DAG
every Friday and short-circuit it based on a Python code calculating if
this is not the last Friday, but custom crontab will be nicer  to see only
the valid dates running.

J

On Mon, Apr 10, 2023 at 5:54 PM Leonard Walstad
<leonard.wals...@astronomer.io.invalid> wrote:

> Dipayan;
>
> This looks like a good use of a timetable if you use Airflow 2.2 or
> above:
> https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/timetable.html
>
> If using an earlier version, you might schedule for every Friday and check
> to see if it is the last Friday in a ShortCircuitOperator and discontinue
> the pipeline:
>
>
> https://registry.astronomer.io/providers/apache-airflow/versions/latest/modules/shortcircuitoperator
>
> Regards,
> Leonard
>
>
>
> Leonard Walstad
> Principal Architect / Customer Success
>
> Astronomer.io <https://astronomer.io/>
> leonard.wals...@astronomer.io
> 617.320.4854
>
>
> On Mon, Apr 10, 2023 at 11:09 AM Dipayan Dev <dev.dipaya...@gmail.com>
> wrote:
>
>> Hi Team,
>>
>> I have a requirement to schedule the Airflow DAG on the last Friday of
>> every month.
>>
>> I was using this cron expression which works on Linux : 0 00 16 ? * 6L.
>> But it throws a DAG import error:
>> *Invalid timetable expression: [0 00 16 ? * 6l] is not acceptable.*
>>
>>
>> Can anyone please help on how to set the scheduler?
>>
>>
>>
>> With Best Regards,
>>
>> Dipayan Dev
>>
>>

Reply via email to