kaxil commented on a change in pull request #11778:
URL: https://github.com/apache/airflow/pull/11778#discussion_r512693203



##########
File path: airflow/utils/helpers.py
##########
@@ -203,3 +205,14 @@ def cross_downstream(*args, **kwargs):
         DeprecationWarning, stacklevel=2
     )
     return 
import_string('airflow.models.baseoperator.cross_downstream')(*args, **kwargs)
+
+
+def build_airflow_url_with_query(query: Dict[str, Any]) -> str:
+    """
+    Build airflow url using base_url and default_view and provided query
+    For example:
+    
'http://0.0.0.0:8000/base/graph?dag_id=my-task&root=&execution_date=2020-10-27T10%3A59%3A25.615587
+    """
+    view = conf.get('webserver', 'dag_default_view').lower()
+    base_url = conf.get('webserver', 'base_url')
+    return parse.urljoin(base_url, view) + "?" + parse.urlencode(query)

Review comment:
       nit: (not required) -- no strong opinion on which is better
   
   ```suggestion
       return f"{parse.urljoin(base_url, view)}?{parse.urlencode(query)}"
   ```




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


Reply via email to