ashb commented on a change in pull request #5743: [AIRFLOW-5088][AIP-24] Persisting serialized DAG in DB for webserver scalability URL: https://github.com/apache/airflow/pull/5743#discussion_r312813475
########## File path: airflow/models/dagbag.py ########## @@ -107,28 +112,51 @@ def size(self): def dag_ids(self): return self.dags.keys() - def get_dag(self, dag_id): + def get_dag(self, dag_id, from_file_only=False): """ Gets the DAG out of the dictionary, and refreshes it if expired + + :param dag_id: DAG Id + :type dag_id: str + :param from_file_only: returns a DAG loaded from file. + :type from_file_only: bool """ from airflow.models.dag import DagModel # Avoid circular import + # Only read DAGs from DB if this dagbag is dagcached_enabled. + # from_file_only is an exception, currently it is for renderring templates + # in UI only. Because functions are gone in serialized DAGs, DAGs must be + # imported from files. + # FIXME: this exception should be removed in future, then webserver can be + # decoupled from DAG files. + if self.dagcached_enabled and not from_file_only: + print(self.dags) Review comment: ```suggestion ``` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services