jedcunningham commented on code in PR #29413:
URL: https://github.com/apache/airflow/pull/29413#discussion_r1120613976
##########
airflow/www/views.py:
##########
@@ -3530,6 +3530,42 @@ def extra_links(self, *, session: Session = NEW_SESSION):
else:
return {"url": None, "error": f"No URL found for {link_name}"}, 404
+ @expose("/object/graph_data")
+ @auth.has_access(
+ [
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_LOG),
+ ]
+ )
+ @gzipped
+ @action_logging
+ @provide_session
+ def graph_data(self, session=None):
+ """Get Graph Data"""
+ dag_id = request.args.get("dag_id")
+ dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session)
+ root = request.args.get("root")
+ if root:
+ filter_upstream = True if request.args.get("filter_upstream") ==
"true" else False
+ filter_downstream = True if request.args.get("filter_downstream")
== "true" else False
Review Comment:
```suggestion
filter_upstream = request.args.get("filter_upstream") == "true"
filter_downstream = request.args.get("filter_downstream") ==
"true"
```
This already gives you a bool 👍
--
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]