I seriously doubt it. We are using croniter, and whatever they accept, we do in airflow. The validation is done by croniter, and the message comes from croniter as well. If this is a bug, it's a bug in the croniter, and possibly opening an issue there might clarify it if you think "L" should be supported there. We will definitely not stand in your way to request it (or even make a PR to support it) - but you should rather discuss it with croniter maintainers than with us. And they show examples with #2 as being supported, while not showing the "L/l" extension as one so likely they simply don't support it.
But I am sure you can clarify with them and they can likely clarify if it is an omission or deliberate choice. I would love to hear what they say, so if you find out, please let us know here. Also - there is no "common" cron specification and except the "standard standard", no choice is a "bug" - because the specification on how cron treats non-standard extensions varies from implementation to implementation. If a random site accepts it, it does not mean all implementations of cron do or should do it. This is actually one of the reasons we introduced custom timetables - because cron expression is so limited and there is no standard (or rather there are few that can be ambiguous) for more expressive time specifications. J. On Tue, Apr 11, 2023 at 7:22 PM Manikandan Ramakrishnan < manikandan.ramakrish...@inmar.com> wrote: > Jarek, > I think this might actually be a bug in airflow. I have been using > 'non-standard' cron in my airflow without any issues (30 7 * * 6#1 - first > saturday of the month). I think the problem here is that airflow seems to > convert cron specification to lowercase (check the error message during dag > import). Where as 'L' has meaning in cron, 'l' does not. You can test the > above cron in this website (https://crontab.cronhub.io/), and see that it > works for uppercase L, but ignores the lowercase L). > > Thanks, > Mani > > On Tue, Apr 11, 2023 at 12:01 PM Jarek Potiuk <ja...@potiuk.com> wrote: > >> 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 >>>> >>>> > ******************************************** > > > > *Inmar Confidentiality Note*: This e-mail and any attachments are > confidential and intended to be viewed and used solely by the intended > recipient. If you are not the intended recipient, be aware that any > disclosure, dissemination, distribution, copying or use of this e-mail or > any attachment is prohibited. If you received this e-mail in error, please > notify us immediately by returning it to the sender and delete this copy > and all attachments from your system and destroy any printed copies. Thank > you for your cooperation. > > > > *Notice of Protected Rights*: The removal of any copyright, trademark, > or proprietary legend contained in this e-mail or any attachment is > prohibited without the express, written permission of Inmar, Inc. > Furthermore, the intended recipient must maintain all copyright notices, > trademarks, and proprietary legends within this e-mail and any attachments > in their original form and location if the e-mail or any attachments are > reproduced, printed or distributed. > > > > ******************************************** >