rodrigoassumpcao opened a new issue, #66101:
URL: https://github.com/apache/airflow/issues/66101

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   3.2.1
   
   ### What happened and how to reproduce it?
   
   Cron presets such as `@quarterly` are not working in Airflow 3.2.1.
   
   It appears that CronMixin does not check the cron_presets mapping before 
instantiating croniter, causing preset expressions to fail validation.
   
   ### Version 3.2.1
   ```Python
   @attrs.define
   class CronMixin:
       """Mixin to provide interface to work with croniter."""
   
       expression: str
       timezone: str | Timezone | FixedTimezone
   
       def validate(self) -> None:
           try:
               croniter(self.expression)
           except (CroniterBadCronError, CroniterBadDateError) as e:
               raise AirflowTimetableInvalid(str(e))
   ```
   
   
   ### Version 3.1.8
   ```Python
   class CronMixin:
       """Mixin to provide interface to work with croniter."""
   
       def __init__(self, cron: str, timezone: str | Timezone | FixedTimezone) 
-> None:
           self._expression = cron_presets.get(cron, cron)
   
           if isinstance(timezone, str):
               timezone = parse_timezone(timezone)
           self._timezone = timezone
   
           try:
               # checking for more than 5 parameters in Cron and avoiding 
evaluation for now,
               # as Croniter has inconsistent evaluation with other libraries
               if len(croniter(self._expression).expanded) > 5:
                   raise FormatException()
   
               self.description = 
self._describe_with_dom_dow_fix(self._expression)
   
           except (CroniterBadCronError, FormatException, 
MissingFieldException):
               self.description = ""
   ```
   
   ### What you think should happen instead?
   
   _No response_
   
   ### Operating System
   
   Debian - bookworm
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to