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

   ### Apache Airflow Provider(s)
   
   standard
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-standard==1.0.0
   
   ### Apache Airflow version
   
   2.10.5, 2.11.0
   
   ### Operating System
   
   Airflow docker
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   Airflow base docker image with minor customisations on EKS
   
   ### What happened
   
   When upgrading airflow-providers-standard to from 1.0.0 to 1.1.0 or 1.2.0 we 
receive the following failure + stacktrace at runtime
   
   ```
   [2025-05-21, 16:35:42 BST] {taskinstance.py:3313} ERROR - Task failed with 
exception
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py",
 line 768, in _execute_task
       result = _execute_callable(context=context, **execute_callable_kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py",
 line 734, in _execute_callable
       return ExecutionCallableRunner(
              ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/utils/operator_helpers.py",
 line 252, in run
       return self.func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/baseoperator.py",
 line 424, in wrapper
       return func(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/standard/operators/branch.py",
 line 105, in execute
       return self.do_branch(context, self.choose_branch(context))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/standard/operators/latest_only.py",
 line 69, in choose_branch
       dates = self._get_compare_dates(dag_run)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/standard/operators/latest_only.py",
 line 110, in _get_compare_dates
       if prev_info := self.dag.timetable.next_dagrun_info(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/timetables/interval.py",
 line 105, in next_dagrun_info
       align_last_data_interval_end = 
self._align_to_prev(last_automated_data_interval.end)
                                      
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/timetables/_cron.py",
 line 145, in _align_to_prev
       prev_time = self._get_prev(current)
                   ^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/timetables/_cron.py",
 line 124, in _get_prev
       return convert_to_utc(current.in_timezone(self._timezone) - delta)
                             ^^^^^^^^^^^^^^^^^^^
   AttributeError: 'datetime.datetime' object has no attribute 'in_timezone'. 
Did you mean: 'astimezone'?
   ```
   
   The dag definition has the following parameters:
   
   ```
           {
               "start_date": datetime(2019, 9, 1),
               "retries": 2,
               "retry_delay": timedelta(minutes=5),
               "catchup": False,
               "max_active_tasks": 1,
               "default_args": default_args,
               "max_active_runs": 1,
               "schedule": "@hourly",
               "tags": [
                   "analytics-ingest",
                   "postgres-ingest",
                   *dag_options.get("tags", []),
               ],
           },
   
   
   ### What you think should happen instead
   
   No error should occur
   
   ### How to reproduce
   
   Due to the simplicity of the DAG I'm inclined to say this occurs on any 
airflow 2.10.5/2.11.0 installation using airflow-providers-standard==1.2.0 
where `schedule="@hourly"` and `LatestOnlyOperator` is used.
   
   ### 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