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_r391711605
##########
File path: airflow/www/views.py
##########
@@ -519,17 +519,23 @@ def last_dagruns(self, session=None):
@has_access
@provide_session
def code(self, session=None):
- dm = models.DagModel
- dag_id = request.args.get('dag_id')
- dag = session.query(dm).filter(dm.dag_id == dag_id).first()
+ all_errors = ""
+
try:
- with wwwutils.open_maybe_zipped(dag.fileloc, 'r') as f:
- code = f.read()
+ dag_id = request.args.get('dag_id')
+ dag_orm = DagModel.get_dagmodel(dag_id, session=session)
+ dag = dag_orm.get_dag(STORE_SERIALIZED_DAGS)
Review comment:
Dag is needed to render the page anyway
----------------------------------------------------------------
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