You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/16 18:30:34 UTC

[GitHub] [airflow] potiuk edited a comment on issue #19618: Execution_date not rendering after airflow upgrade

potiuk edited a comment on issue #19618:
URL: https://github.com/apache/airflow/issues/19618#issuecomment-970551844


   I believe I know what the problem is. yes the `dag_run.logical_date` should work and I know what the problem is  @uranusjr 
   
   @uranusjr  - this is the "coerce_date" in following_schedule:
   
   ```
       def following_schedule(self, dttm):
           """
           Calculates the following schedule for this dag in UTC.
   
           :param dttm: utc datetime
           :return: utc datetime
           """
           warnings.warn(
               "`DAG.following_schedule()` is deprecated. Use `DAG.next_dagrun_info(restricted=False)` instead.",
               category=DeprecationWarning,
               stacklevel=2,
           )
           data_interval = self.infer_automated_data_interval(timezone.coerce_datetime(dttm))
           next_info = self.next_dagrun_info(data_interval, restricted=False)
           if next_info is None:
               return None
           return next_info.data_interval.start
   ```
   
   Here is `coerce_date`:
   
   ```
   
   def coerce_datetime(v: Union[None, dt.datetime, DateTime]) -> Optional[DateTime]:
       """Convert whatever is passed in to an timezone-aware ``pendulum.DateTime``."""
       if v is None:
           return None
       if v.tzinfo is None:
           v = make_aware(v)
       if isinstance(v, DateTime):
           return v
       return pendulum.instance(v)
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org