[ 
https://issues.apache.org/jira/browse/AIRFLOW-4342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16820869#comment-16820869
 ] 

ASF subversion and git services commented on AIRFLOW-4342:
----------------------------------------------------------

Commit 4f46bbbe45672d574be5485a6747988be8127e3f in airflow's branch 
refs/heads/v1-10-test from Ash Berlin-Taylor
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=4f46bbb ]

[AIRFLOW-4342] Use @cached_property instead of re-implementing it each time 
(#5126)

It's not many lines, but I just find this much clearer

> Replace ad-hoc cached-properties with module
> --------------------------------------------
>
>                 Key: AIRFLOW-4342
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4342
>             Project: Apache Airflow
>          Issue Type: Improvement
>            Reporter: Ash Berlin-Taylor
>            Assignee: Ash Berlin-Taylor
>            Priority: Minor
>
> In a few places in the code base we have something that looks like:
> {code}
> @property
> def x(self):
>    if not self._x:
>        self._x = self._build_x()
>     return self._x
> {code}
>  Instead we should use something like 
> https://pypi.org/project/cached-property/ to make it more declarative for us 
> :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to