mik-laj commented on a change in pull request #7217: [AIRFLOW-5946] Store
source code in db
URL: https://github.com/apache/airflow/pull/7217#discussion_r383046137
##########
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:
The property that invokes a database query is very dangerous. This can
result in a mistake that has a big impact on performance.
Here is an example:
https://github.com/apache/airflow/pull/7476
The property that calls the database query caused the scheduler to run 33%
slower. While reviewing the code, we never could see this problem.
----------------------------------------------------------------
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