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 2020/04/09 10:15:53 UTC

[GitHub] [airflow] ashb commented on a change in pull request #8225: Move DAG._schedule_interval logic out of DAG.__init__

ashb commented on a change in pull request #8225: Move DAG._schedule_interval logic out of DAG.__init__
URL: https://github.com/apache/airflow/pull/8225#discussion_r406103116
 
 

 ##########
 File path: airflow/models/dag.py
 ##########
 @@ -626,6 +620,24 @@ def is_paused(self) -> bool:
         """
         return self._get_is_paused()
 
+    @property
 
 Review comment:
   Maybe, the downside to cached_property would be if dag.schedule_interval is changed, this parameter would be out of sync.
   
   We could do it as:
   
   ```python
       @property
       def normalized_schedule_interval(self) -> Optional[ScheduleInterval]:
           return self._normalized_schedule_interval(self.schedule_interval)
   
       @functools.lru_cache(maxsize=1)
       def _normalized_schedule_interval(self, schedule_interval) -> Optional[ScheduleInterval]: 
           ...
   ```
   
   Might be overkill.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services