anitakar commented on a change in pull request #7217: [AIRFLOW-5946] Store
source code in db
URL: https://github.com/apache/airflow/pull/7217#discussion_r383202707
##########
File path: airflow/models/dag.py
##########
@@ -1753,6 +1756,44 @@ def get_last_dagrun(self, session=None,
include_externally_triggered=False):
def safe_dag_id(self):
return self.dag_id.replace('.', '__dot__')
+ @property
+ def code(self):
Review comment:
Sure, it is a bad practice in any language to have heavy processing in
something that seems to be a getter.
My question is, can you somehow cache value as for example _source_code in a
class that represents a table in sql alchemy and whatever we have on top of it?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services