uranusjr commented on code in PR #23510:
URL: https://github.com/apache/airflow/pull/23510#discussion_r877191682


##########
airflow/www/security.py:
##########
@@ -200,6 +200,12 @@ def __init__(self, appbuilder):
             view.datamodel = CustomSQLAInterface(view.datamodel.obj)
         self.perms = None
 
+    def _is_subdag(self, dag_id):
+        if '.' in dag_id:
+            dm = 
self.get_session.query(DagModel.is_subdag).filter(DagModel.dag_id == 
dag_id).first()
+            return dm.is_subdag if dm else False

Review Comment:
   ```suggestion
               return 
self.get_session.query(DagModel.is_subdag).filter(DagModel.dag_id == 
dag_id).scalar()
   ```
   
   This should work as well. It returns `None` if the DAG does not exist, which 
is fine for its usages.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to